コード例 #1
0
        public void StringReader_should_return_written_data()
        {
            var writer = new SpoolWriter();
            writer.Write("Hello world");

            var reader = new SpoolReader(writer);
            var content = reader.ReadToEnd();

            Assert.That(content, Is.EqualTo("Hello world"));
        }
コード例 #2
0
        public void Multiple_writes_are_combined()
        {
            var writer = new SpoolWriter();
            writer.Write("Hello");
            writer.Write(' ');
            writer.Write("World");

            var reader = new SpoolReader(writer);
            var content = reader.ReadToEnd();

            Assert.That(content, Is.EqualTo("Hello World"));
        }
コード例 #3
0
        public void Empty_and_null_writes_are_acceptable()
        {
            var writer = new SpoolWriter();
            writer.Write("a");
            writer.Write("");
            writer.Write((string)null);
            writer.Write("b");

            var reader = new SpoolReader(writer);
            var content = reader.ReadToEnd();
            Assert.That(content, Is.EqualTo("ab"));
        }