示例#1
0
        public void op_FromString_stringEmpty()
        {
            var expected = new TextPlain(string.Empty);
            var actual   = TextPlain.FromString(string.Empty);

            Assert.Equal(expected, actual);
        }
示例#2
0
        public void opImplicit_TextPlain_stringEmpty()
        {
            var       expected = new TextPlain(string.Empty);
            TextPlain actual   = string.Empty;

            Assert.Equal(expected, actual);
        }
示例#3
0
        public void op_FromString_string()
        {
            var expected = new TextPlain("value");
            var actual   = TextPlain.FromString("value");

            Assert.Equal(expected, actual);
        }
示例#4
0
        public void op_ToString_whenNotNull()
        {
            const string expected = "value";
            var          actual   = new TextPlain(expected).ToString();

            Assert.Equal(expected, actual);
        }
示例#5
0
        public void opImplicit_TextPlain_string()
        {
            var       expected = new TextPlain("value");
            TextPlain actual   = "value";

            Assert.Equal(expected, actual);
        }
示例#6
0
        public void op_FromString_string()
        {
            var expected = new TextPlain("value");
            var actual = TextPlain.FromString("value");

            Assert.Equal(expected, actual);
        }
示例#7
0
        public void op_ToString()
        {
            var expected = string.Empty;
            var actual   = new TextPlain().ToString();

            Assert.Equal(expected, actual);
        }
示例#8
0
        public void opImplicit_TextPlain_stringEmpty()
        {
            var expected = new TextPlain(string.Empty);
            TextPlain actual = string.Empty;

            Assert.Equal(expected, actual);
        }
示例#9
0
        public void opImplicit_TextPlain_string()
        {
            var expected = new TextPlain("value");
            TextPlain actual = "value";

            Assert.Equal(expected, actual);
        }
示例#10
0
        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);
        }
示例#11
0
 public void op_FromString_stringNull()
 {
     Assert.Throws <ArgumentNullException>(() => TextPlain.FromString(null));
 }
示例#12
0
        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);
        }
示例#13
0
        public void op_FromString_stringEmpty()
        {
            var expected = new TextPlain(string.Empty);
            var actual = TextPlain.FromString(string.Empty);

            Assert.Equal(expected, actual);
        }
示例#14
0
        public void op_ToString_whenNotNull()
        {
            const string expected = "value";
            var actual = new TextPlain(expected).ToString();

            Assert.Equal(expected, actual);
        }
示例#15
0
        public void op_ToString()
        {
            var expected = string.Empty;
            var actual = new TextPlain().ToString();

            Assert.Equal(expected, actual);
        }