public void BoolHelperTest_Failure(object bl) { using var stream = new MemoryStream(); using var writer = new StreamWriter(stream); Assert.ThrowsException <ArgumentException>(() => { JsonHelpers.BoolHelper(writer, new object(), new [] { bl }); }); }
public void BoolHelperTest(object bl, string expectedValue) { using var stream = new MemoryStream(); using var writer = new StreamWriter(stream); using var reader = new StreamReader(stream); JsonHelpers.BoolHelper(writer, new object(), new [] { bl }); writer.Flush(); stream.Position = 0; var result = reader.ReadToEnd(); Assert.AreEqual(expectedValue, result); }