public void PrintWithFormatPrints() { var listener = new StringTraceListener(); Trace.Listeners.Add(listener); var x = Op.Scalar <float>("x"); var print = Op.Function(input: x, output: Op.Print("Hell{0} world", x)); print(0); Assert.AreEqual("Hell0 world" + "\r\n", listener.content.ToString()); }
public void PrintPrints() { var listener = new StringTraceListener(); Trace.Listeners.Add(listener); var x = Op.Scalar <string>("x"); var print = Op.Function(input: x, output: Op.Print(x)); var message = "Hello World"; print(message); Assert.AreEqual(message + "\r\n", listener.content.ToString()); }
public void SetUp() { this.listener = new StringTraceListener(); Trace.Listeners.Clear(); Trace.Listeners.Add(this.listener); }