public TestVerdict ScratchMethod()
        {
            try
            {
                //using (var testMetric = new TestMetric("9999", "Test metric description"))
                //{
                //    testMetric.Start();
                //    Thread.Sleep(5000);
                //    testMetric.Stop();
                //};

                var testCheck = TestCheck.IsTrue("This is the first a sample test check", false, "I expected this to fail");
                testCheck = TestCheck.IsTrue("This is the second a sample test check", true, "I expected this to pass.");
                testCheck = TestCheck.IsTrue("This is the third a sample test check", false, $"Expected:  Pass, Actual:  Fail.");

                TestWarning.IsTrue(false, "This is a sample test warning.");

                TestTrace.Trace("This is a sample trace message");

                Thread.Sleep(5000);

                TestMessage += "Completed!";
                TestVerdict  = TestVerdict.Pass;
            }
            catch (Exception e)
            {
                TestMessage += e.ToString();
                TestVerdict  = TestVerdict.Error;
            }
            finally
            {
            }

            return(TestVerdict);
        }
Example #2
0
        public TestVerdict MyTestMethod(
            [TestParameter("String parameter", "Enter string parameter", "Default value")]
            string param1,
            [TestParameter("Int parameter", "Enter integer parameter", 0)]
            int param2,
            [TestParameter("Boolean parameter", "Enter boolean parameter", true)]
            bool param3)
        {
            try
            {
                Setup();

                TestTrace.Trace("This is a sample TestTrace message.");

                TestAssert.IsTrue(param3, "This is a sample assertion.");

                TestCheck.IsTrue("Test of param3", param3, "This is a sample TestCheck.");

                TestMessage += "This is the returned test message.";
                TestVerdict  = TestVerdict.Pass;
            }
            catch (TestAssertFailedException e)
            {
                TestMessage += e.ToString();
                TestVerdict  = TestVerdict.Fail;
            }
            catch (Exception e)
            {
                TestMessage += e.ToString();
                TestVerdict  = TestVerdict.Error;
            }
            finally
            {
                Teardown();
            }

            return(TestVerdict);
        }