mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-03-24 10:22:13 +01:00
Generate C# code from Mapping (#842)
* 1 * . * v * . * . * - * b * res b * Fix UT * . * Verify * v * ... * . * . * dir * m
This commit is contained in:
@@ -1,30 +1,29 @@
|
||||
using System.Text;
|
||||
using System.Text;
|
||||
using FluentAssertions;
|
||||
using WireMock.Util;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Util
|
||||
namespace WireMock.Net.Tests.Util;
|
||||
|
||||
public class BytesEncodingUtilsTests
|
||||
{
|
||||
public class BytesEncodingUtilsTests
|
||||
[Fact]
|
||||
public void TryGetEncoding_UTF32()
|
||||
{
|
||||
[Fact]
|
||||
public void TryGetEncoding_UTF32()
|
||||
{
|
||||
var result = BytesEncodingUtils.TryGetEncoding(new byte[] { 0xff, 0xfe, 0x00, 0x00 }, out Encoding encoding);
|
||||
var result = BytesEncodingUtils.TryGetEncoding(new byte[] { 0xff, 0xfe, 0x00, 0x00 }, out Encoding encoding);
|
||||
|
||||
// Assert
|
||||
result.Should().BeTrue();
|
||||
encoding.CodePage.Should().Be(Encoding.UTF32.CodePage);
|
||||
}
|
||||
// Assert
|
||||
result.Should().BeTrue();
|
||||
encoding.CodePage.Should().Be(Encoding.UTF32.CodePage);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TryGetEncoding_Invalid()
|
||||
{
|
||||
var result = BytesEncodingUtils.TryGetEncoding(new byte[] { 0xff }, out Encoding encoding);
|
||||
[Fact]
|
||||
public void TryGetEncoding_Invalid()
|
||||
{
|
||||
var result = BytesEncodingUtils.TryGetEncoding(new byte[] { 0xff }, out Encoding encoding);
|
||||
|
||||
// Assert
|
||||
result.Should().BeFalse();
|
||||
encoding.Should().BeNull();
|
||||
}
|
||||
// Assert
|
||||
result.Should().BeFalse();
|
||||
encoding.Should().BeNull();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user