示例#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());
 }