예제 #1
0
        public void TestWithExceptions()
        {
            var test = new SpeedWatchTest("Simple Test",
                                          () => SampleActions.ThrowOnEven(2), 2, "");
            var result = test.GetSummary();

            Assert.IsNotNull(result);
            Assert.IsTrue(result.TestResults.Count == 2);
            Assert.IsTrue(result.PassedTests == 0);
            Assert.IsTrue(result.FailedTests == 2);
            Trace.WriteLine(test.GetSummary().ToString());
        }
예제 #2
0
        public void TestWithNoExceptionsAsyncResult()
        {
            var task1 = SampleActions.WaitTwoSecondsAsync();
            var task2 = SampleActions.WaitTwoSecondsAsync();

            var test = new SpeedWatchTest("Simple Test", () => Task.WaitAll(task1, task2),
                                          5, "");
            var result = test.GetResults();

            Assert.IsNotNull(result);
            Assert.IsTrue(result.Count == 5);
            foreach (var r in result)
            {
                Assert.IsTrue(r.Exception == null);
            }
        }