public async Task Test_Utils_default_SerializeObject_string() { string original = "dog"; string expected = $"\"{original}\""; JsonDocumentWriter jsonDocumentWriter = new JsonDocumentWriter(); var actual = jsonDocumentWriter.SerializeObject(original); expected.ShouldBe(actual); }
public async Task Test_Utils_SerializeObject_string() { string original = "dog"; string expected = $"\"{original}\""; JsonDocumentWriter jsonDocumentWriter = new JsonDocumentWriter(true); jsonDocumentWriter.JsonSerializerSettings.ShouldNotBeNull(); var actual = jsonDocumentWriter.SerializeObject(original); expected.ShouldBe(actual); }
public async Task Test_Utils_SerializeObject_array_string() { object original = new[] { "dog" }; string inside = $"{Environment.NewLine} \"dog\"{Environment.NewLine}"; StringBuilder sb = new StringBuilder(); sb.Append('['); sb.Append(inside); sb.Append(']'); string expected = sb.ToString(); JsonDocumentWriter jsonDocumentWriter = new JsonDocumentWriter(true); var actual = jsonDocumentWriter.SerializeObject(original); expected.ShouldBe(actual); }