public void TestRunTestMethod()
        {
            ExpectedExceptionCountAttribute expectedException = new ExpectedExceptionCountAttribute(typeof(Exception), 0);
            ITest test;

            test = MockTestingHelper.CreatePassTest();
            expectedException.RunTest(test);
            Assert.AreEqual(TestStatus.Pass, test.Result.Status);

            test = MockTestingHelper.CreateFailTest();
            expectedException.RunTest(test);
            Assert.AreEqual(TestStatus.Fail, test.Result.Status);

            expectedException.FailOnOtherExceptions = false;
            expectedException.RunTest(test);
            Assert.AreEqual(TestStatus.Pass, test.Result.Status);

            expectedException.ExceptionCount = 1;
            expectedException.RunTest(test);
            Assert.AreEqual(TestStatus.Fail, test.Result.Status);

            expectedException.ExceptionType = _assertionException;
            expectedException.RunTest(test);
            Assert.AreEqual(TestStatus.Pass, test.Result.Status);

            expectedException.ExceptionCount = 0;
            expectedException.RunTest(test);
            Assert.AreEqual(TestStatus.Fail, test.Result.Status);
        }
        public void TestExecutionTimeFail()
        {
            MaximumExecutionTimeAttribute meta = new MaximumExecutionTimeAttribute(1);
            ITest t = MockTestingHelper.CreateTest(this.GetType().GetMethod("Test"));

            meta.RunTest(t);

            Assert.AreEqual(TestStatus.Fail, t.Result.Status);
        }
        public void TestRunInvalidTestMethod()
        {
            ExpectedExceptionCountAttribute expectedException = new ExpectedExceptionCountAttribute(typeof(Exception), 1);
            ITest test;

            test = MockTestingHelper.CreatePassTest();
            test.Fixture.FixtureType = typeof(ExpectedExceptionCountAttributeTests);
            test.TestMethod          = test.Fixture.FixtureType.GetMethod("InvalidTest");
            expectedException.RunTest(test);
        }
        public void TestRunTestMethod()
        {
            ExpectedExceptionAttribute expectedException = new ExpectedExceptionAttribute(_assertionException);
            ITest test;

            test = MockTestingHelper.CreatePassTest();
            expectedException.RunTest(test);
            Assert.AreEqual(TestStatus.Fail, test.Result.Status);

            test = MockTestingHelper.CreateFailTest();
            expectedException.RunTest(test);
            Assert.AreEqual(TestStatus.Pass, test.Result.Status);

            expectedException.Message = "Invalid message";
            expectedException.RunTest(test);
            Assert.AreEqual(TestStatus.Fail, test.Result.Status);

            expectedException.Message = MockFixture.FailMessage;
            expectedException.RunTest(test);
            Assert.AreEqual(TestStatus.Pass, test.Result.Status);
        }