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_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_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 AnyContentElement AddContent(object value) { var newContent = new SimpleBlock().Value(value); if (content == null) { content = newContent; } else { content.Append(newContent); } return(this); }
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()); } }
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()); } }