mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-19 15:31:39 +02:00
Fix CSharpFormatterTests
This commit is contained in:
@@ -97,7 +97,7 @@ internal static class CSharpFormatter
|
|||||||
});
|
});
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public static string ConvertToAnonymousObjectDefinition(object jsonBody, int ind = 1)
|
public static string ConvertToAnonymousObjectDefinition(object jsonBody, int ind = 2)
|
||||||
{
|
{
|
||||||
var serializedBody = JsonConvert.SerializeObject(jsonBody);
|
var serializedBody = JsonConvert.SerializeObject(jsonBody);
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ public class CSharpFormatterTests
|
|||||||
var expectedOutput = "new\r\n {\r\n Key1 = \"value1\",\r\n Key2 = 42,\r\n F = 1.2\r\n }";
|
var expectedOutput = "new\r\n {\r\n Key1 = \"value1\",\r\n Key2 = 42,\r\n F = 1.2\r\n }";
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
var result = CSharpFormatter.ConvertToAnonymousObjectDefinition(jsonBody);
|
var result = CSharpFormatter.ConvertToAnonymousObjectDefinition(jsonBody, 1);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
result.Should().Be(expectedOutput);
|
result.Should().Be(expectedOutput);
|
||||||
@@ -31,7 +31,7 @@ public class CSharpFormatterTests
|
|||||||
var expectedOutput = "new []\r\n {\r\n new\r\n {\r\n test = \"a\"\r\n },\r\n new\r\n {\r\n test = \"b\"\r\n }\r\n }";
|
var expectedOutput = "new []\r\n {\r\n new\r\n {\r\n test = \"a\"\r\n },\r\n new\r\n {\r\n test = \"b\"\r\n }\r\n }";
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
var result = CSharpFormatter.ConvertToAnonymousObjectDefinition(jsonBody);
|
var result = CSharpFormatter.ConvertToAnonymousObjectDefinition(jsonBody, 1);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
result.Should().Be(expectedOutput);
|
result.Should().Be(expectedOutput);
|
||||||
|
|||||||
Reference in New Issue
Block a user