示例#1
0
        public void TextWriter_Can_Not_Be_Null()
        {
            TextWriter writer = null;

            var raw = new RawString("value");

            Assert.Throws <ArgumentNullException>(() => { raw.WriteTo(writer); });
        }
示例#2
0
        public void WriteTo_Writes_ToSpecifiedWriter()
        {
            string value = "value";
            var    raw   = new RawString(value);

            var writer = new StringWriter();

            raw.WriteTo(writer);

            string result = writer.ToString();

            Assert.NotNull(result);
            Assert.Equal(value, result);
        }