public void Test_Content_StringWithoutEncoding() { var sample = "<h1>Hello!</h1>"; var sc = new SimpleBlock().Value(sample, true); using (var sw = new StringWriter()) { sc.WriteTo(sw, contextMock.Object); Assert.Equal(sample, sw.ToString()); } }
public void Test_Content_Calls_ContextWrite() { var obj = new object(); using (var sw = new StringWriter()) { var sc = new SimpleBlock().Value(obj); sc.WriteTo(sw, contextMock.Object); contextMock.Verify(); } }
public void Test_Content_StringWithEncoding() { var sample = "<h1>Hello!</h1>"; var sampleEncoded = "<h1>Hello!</h1>"; var sc = new SimpleBlock().Value(sample); using (var sw = new StringWriter()) { sc.WriteTo(sw, contextMock.Object); Assert.Equal(sampleEncoded, sw.ToString()); } }
public void Test_ContentKnows_WritableBlock() { var sample = "<test>"; var obj = new DummyWritableBlock() { Content = sample }; using (var sw = new StringWriter()) { var sc = new SimpleBlock().Value(obj); sc.WriteTo(sw, contextMock.Object); Assert.Equal(sample, sw.ToString()); } }