mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-03-27 20:01:52 +01:00
Add more unitests for CSharpFormatter utils (#938)
* Add unit-tests for CSharpFormatter * . * t
This commit is contained in:
@@ -10,17 +10,17 @@ public class BytesEncodingUtilsTests
|
||||
[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 var encoding);
|
||||
|
||||
// Assert
|
||||
result.Should().BeTrue();
|
||||
encoding.CodePage.Should().Be(Encoding.UTF32.CodePage);
|
||||
encoding?.CodePage.Should().Be(Encoding.UTF32.CodePage);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TryGetEncoding_Invalid()
|
||||
{
|
||||
var result = BytesEncodingUtils.TryGetEncoding(new byte[] { 0xff }, out Encoding encoding);
|
||||
var result = BytesEncodingUtils.TryGetEncoding(new byte[] { 0xff }, out var encoding);
|
||||
|
||||
// Assert
|
||||
result.Should().BeFalse();
|
||||
|
||||
Reference in New Issue
Block a user