mirror of https://github.com/SixLabors/ImageSharp
committed by
GitHub
7 changed files with 49 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 |
|||
@ -0,0 +1,3 @@ |
|||
version https://git-lfs.github.com/spec/v1 |
|||
oid sha256:f0919126bfa5be74782e6db4bd8fb82c6211ea2cca1f6b76cfa9cee7fdd418ff |
|||
size 36885 |
|||
@ -0,0 +1,3 @@ |
|||
version https://git-lfs.github.com/spec/v1 |
|||
oid sha256:14bd38b41f94e86c56ebc3b1612ced04fa4741982d916e01d6e3bf75e6c80f26 |
|||
size 5587341 |
|||
Loading…
Reference in new issue