public void RaiseIfTwoArguments() { StringWriter writer = new StringWriter(); Print print = new Print(writer); Assert.Throws <InvalidOperationException>(() => print.Call(null, new object[] { "hello", "world" })); }
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()); }
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()); }
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()); }