예제 #1
0
        public void ExceptionsThrownWhenSettingFixturesProperlyReported()
        {
            var testClassCommand = new TestClassCommand(Reflector.Wrap(typeof(SetFixtureFailureSpy)));

            testClassCommand.ClassStart();

            var method       = testClassCommand.TypeUnderTest.GetMethod("Method");
            var testCommands = TestCommandFactory.Make(testClassCommand, method);

            var methodResult = testCommands.Single().Execute(null);

            // If you get a test failure here, then there's another missing instance of "throw;" where there
            // is a call to RethrowWithNoStackTraceLoss. Specifically, for this test, it's in FixtureCommand.Execute
            // Again, it should look like:
            //
            // catch (TargetInvocationException ex)
            // {
            //     ExceptionUtility.RethrowWithNoStackTraceLoss(ex.InnerException);
            //     throw;  // <---- New line
            // }
            if (!(methodResult is FailedResult))
            {
                throw new ExceptionNotBeingRethrownException("FixtureCommand.Execute");
            }

            Assert.Equal("System.Reflection.TargetInvocationException", ((FailedResult)methodResult).ExceptionType);
        }
예제 #2
0
            public Exception ClassStart()
            {
                GuardTypeUnderTest();
                var xunitAssembly = typeof(FactAttribute).Assembly;

                sandbox = CreatePartialTrustAppDomain();

                return(originalTestClassCommand.ClassStart());
            }
예제 #3
0
 public Exception ClassStart()
 {
     return(cmd.ClassStart());
 }
예제 #4
0
 /// <inheritdoc/>
 public Exception ClassStart()
 {
     return(_testClassCommand.ClassStart());
 }
예제 #5
0
 public Exception ClassStart()
 {
     return(_inner.ClassStart());
 }
 public virtual Exception ClassStart()
 {
     return(_cmd.ClassStart());
 }