Esempio n. 1
0
        public void RaiseIfTwoArguments()
        {
            StringWriter writer = new StringWriter();
            Print        print  = new Print(writer);

            Assert.Throws <InvalidOperationException>(() => print.Call(null, new object[] { "hello", "world" }));
        }
Esempio n. 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());
 }
Esempio n. 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());
 }
Esempio n. 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());
 }
Esempio n. 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());
        }
Esempio n. 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());
        }
Esempio n. 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());
        }