public void op_FromString_stringEmpty() { var expected = new TextPlain(string.Empty); var actual = TextPlain.FromString(string.Empty); Assert.Equal(expected, actual); }
public void opImplicit_TextPlain_stringEmpty() { var expected = new TextPlain(string.Empty); TextPlain actual = string.Empty; Assert.Equal(expected, actual); }
public void op_FromString_string() { var expected = new TextPlain("value"); var actual = TextPlain.FromString("value"); Assert.Equal(expected, actual); }
public void op_ToString_whenNotNull() { const string expected = "value"; var actual = new TextPlain(expected).ToString(); Assert.Equal(expected, actual); }
public void opImplicit_TextPlain_string() { var expected = new TextPlain("value"); TextPlain actual = "value"; Assert.Equal(expected, actual); }
public void op_ToString() { var expected = string.Empty; var actual = new TextPlain().ToString(); Assert.Equal(expected, actual); }
public void op_ToContent_TextReaderEmpty() { IContent body; using (var stream = new MemoryStream()) { using (var writer = new StreamWriter(stream)) { writer.Flush(); stream.Position = 0; using (var reader = new StreamReader(stream)) { body = new TextPlain().ToContent(reader); } } } Assert.Equal(string.Empty, ((TextPlain)body).Value); }
public void op_FromString_stringNull() { Assert.Throws <ArgumentNullException>(() => TextPlain.FromString(null)); }
public void op_ToContent_TextReader() { IContent body; using (var stream = new MemoryStream()) { using (var writer = new StreamWriter(stream)) { writer.Write("text"); writer.Flush(); stream.Position = 0; using (var reader = new StreamReader(stream)) { body = new TextPlain().ToContent(reader); } } } Assert.Equal("text", ((TextPlain)body).Value); }