示例#1
0
        public void testCommandExecuteWithWrongParameters1()
        {
            testcmd.checkNumberOfParametersReturnValue = false;
            commandInvoker.ExecuteCommand("dir param1 param2", output);

            Assert.IsTrue(testcmd.executed == false);
            Assert.IsTrue(testcmd.getParams().Count == 2);
            Assert.IsTrue(testcmd.numberOfParamsPassed == 2);
            Assert.IsTrue(output.ToString().ToLower().Contains("wrong"));
            Assert.IsTrue(output.ToString().ToLower().Contains("parameter"));
        }
示例#2
0
        /// <summary>
        /// Called when the test creates text output.
        /// </summary>
        /// <param name="testOutput">A console message</param>
        public void TestOutput(TestOutput testOutput)
        {
            try
            {
#if false
                string report = string.Format("<output type=\"{0}\"><text>{1}</text></output>",
                                              testOutput.Type, testOutput.Text);

                handler.RaiseCallbackEvent(report);
#else
                handler.RaiseCallbackEvent(testOutput.ToXml(false).OuterXml);
#endif
            }
            catch (Exception ex)
            {
                log.Error("Exception processing: " + testOutput.ToString() + NUnit.Env.NewLine + ex.ToString());
            }
        }
示例#3
0
 public static void AssertOutputIsEmpty(TestOutput testOutput)
 {
     Assert.IsNotNull(testOutput);
     Assert.AreEqual(0, testOutput.ToString().Length);
 }
示例#4
0
 public void TestOutput(TestOutput testOutput)
 {
     _log.Info("Test output: " + testOutput.ToString());
 }