mirror of https://github.com/SixLabors/ImageSharp
committed by
GitHub
7 changed files with 43 additions and 2 deletions
@ -0,0 +1,32 @@ |
|||||
|
// Copyright (c) Six Labors and contributors.
|
||||
|
// Licensed under the Apache License, Version 2.0.
|
||||
|
|
||||
|
using System; |
||||
|
using System.Text; |
||||
|
using Xunit; |
||||
|
|
||||
|
namespace SixLabors.ImageSharp.Tests.Common |
||||
|
{ |
||||
|
public class EncoderExtensionsTests |
||||
|
{ |
||||
|
[Fact] |
||||
|
public void GetString_EmptyBuffer_ReturnsEmptyString() |
||||
|
{ |
||||
|
var buffer = new ReadOnlySpan<byte>(); |
||||
|
|
||||
|
string result = Encoding.UTF8.GetString(buffer); |
||||
|
|
||||
|
Assert.Equal(string.Empty, result); |
||||
|
} |
||||
|
|
||||
|
[Fact] |
||||
|
public void GetString_Buffer_ReturnsString() |
||||
|
{ |
||||
|
var buffer = new ReadOnlySpan<byte>(new byte[] { 73, 109, 97, 103, 101, 83, 104, 97, 114, 112 }); |
||||
|
|
||||
|
string result = Encoding.UTF8.GetString(buffer); |
||||
|
|
||||
|
Assert.Equal("ImageSharp", result); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -1 +1 @@ |
|||||
Subproject commit ee90e5f32218027744b5d40058b587cc1047b76f |
Subproject commit c6980db777e49d5e526b56cb986001d1a191acdf |
||||
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 5.3 MiB |
Loading…
Reference in new issue