public void WriteLine_Object_HtmlContent_AddsToEntries() { // Arrange var buffer = new TestHtmlContentBuilder(); var writer = new HtmlContentWrapperTextWriter(buffer, Encoding.UTF8); var content = new HtmlString("Hello, world!"); // Act writer.WriteLine(content); // Assert Assert.Collection( buffer.Values, item => Assert.Same(content, item), item => Assert.Equal(Environment.NewLine, item)); }
public async Task Write_WritesStringBuffer() { // Arrange var newLine = Environment.NewLine; var input1 = "Hello"; var input2 = "from"; var input3 = "ASP"; var input4 = ".Net"; var buffer = new TestHtmlContentBuilder(); var writer = new HtmlContentWrapperTextWriter(buffer, Encoding.UTF8); // Act writer.Write(input1); writer.WriteLine(input2); await writer.WriteAsync(input3); await writer.WriteLineAsync(input4); // Assert Assert.Equal(new[] { input1, input2, newLine, input3, input4, newLine }, buffer.Values); }
public void WriteLine_Object_HtmlContent_AddsToEntries() { // Arrange var buffer = new TestHtmlContentBuilder(); var writer = new HtmlContentWrapperTextWriter(buffer, Encoding.UTF8); var content = new HtmlString("Hello, world!"); // Act writer.WriteLine(content); // Assert Assert.Collection( buffer.Values, item => Assert.Same(content, item), item => Assert.Equal(Environment.NewLine, item)); }
public async Task Write_WritesStringBuffer() { // Arrange var newLine = Environment.NewLine; var input1 = "Hello"; var input2 = "from"; var input3 = "ASP"; var input4 = ".Net"; var buffer = new TestHtmlContentBuilder(); var writer = new HtmlContentWrapperTextWriter(buffer, Encoding.UTF8); // Act writer.Write(input1); writer.WriteLine(input2); await writer.WriteAsync(input3); await writer.WriteLineAsync(input4); // Assert Assert.Equal(new[] { input1, input2, newLine, input3, input4, newLine }, buffer.Values); }