Exemple #1
0
        public void RaiseIfTwoArguments()
        {
            StringWriter writer = new StringWriter();
            Print        print  = new Print(writer);

            Assert.Throws <InvalidOperationException>(() => print.Call(null, new object[] { "hello", "world" }));
        }
Exemple #2
0
 public void WriteLine()
 {
     StringWriter writer = new StringWriter();
     Print print = new Print(writer);
     var result = print.Call(null, new object[] { "hello" });
     Assert.IsNull(result);
     writer.Close();
     Assert.AreEqual("hello\r\n", writer.ToString());
 }
Exemple #3
0
 public void WriteEmptyLine()
 {
     StringWriter writer = new StringWriter();
     Print print = new Print(writer);
     var result = print.Call(null, null);
     Assert.IsNull(result);
     writer.Close();
     Assert.AreEqual("\r\n", writer.ToString());
 }
Exemple #4
0
 public void RaiseIfTwoArguments()
 {
     StringWriter writer = new StringWriter();
     Print print = new Print(writer);
     var result = print.Call(null, new object[] { "hello", "world" });
     Assert.IsNull(result);
     writer.Close();
     Assert.AreEqual("hello\r\nworld\r\n", writer.ToString());
 }
Exemple #5
0
        public void WriteEmptyLine()
        {
            StringWriter writer = new StringWriter();
            Print        print  = new Print(writer);
            var          result = print.Call(null, null);

            Assert.IsNull(result);
            writer.Close();
            Assert.AreEqual("\r\n", writer.ToString());
        }
Exemple #6
0
        public void WriteLine()
        {
            StringWriter writer = new StringWriter();
            Print        print  = new Print(writer);
            var          result = print.Call(null, new object[] { "hello" });

            Assert.IsNull(result);
            writer.Close();
            Assert.AreEqual("hello\r\n", writer.ToString());
        }
Exemple #7
0
        public void RaiseIfTwoArguments()
        {
            StringWriter writer = new StringWriter();
            Print        print  = new Print(writer);
            var          result = print.Call(null, new object[] { "hello", "world" });

            Assert.IsNull(result);
            writer.Close();
            Assert.AreEqual("hello\r\nworld\r\n", writer.ToString());
        }