public void ShouldPerformCaseExecutionBehaviorForAllGivenCases() { var cases = new[] { new Case(testClass, Method("Pass")), new Case(testClass, Method("Fail")) }; var executeCases = new ExecuteCases(); var fixture = new Fixture(testClass, new SampleTestClass(), convention.CaseExecution.Behavior, new InvokeMethod(), cases); executeCases.Execute(fixture); cases[0].Exceptions.Any().ShouldBeFalse(); cases[1].Exceptions.ToArray().Single().Message.ShouldEqual("'Fail' failed!"); log.ShouldEqual("Pass", "Fail"); }
public void ShouldPerformCaseExecutionBehaviorForAllGivenCases() { var caseA = new Case(testClass.GetInstanceMethod("Pass")); var caseB = new Case(testClass.GetInstanceMethod("Fail")); var caseExecutions = new[] { new CaseExecution(caseA), new CaseExecution(caseB) }; var executeCases = new ExecuteCases(); var executionPlan = new ExecutionPlan(convention); var instanceExecution = new InstanceExecution(executionPlan, testClass, new SampleTestClass(), caseExecutions); executeCases.Execute(instanceExecution); caseExecutions[0].Exceptions.Any().ShouldBeFalse(); caseExecutions[1].Exceptions.Single().Message.ShouldEqual("'Fail' failed!"); log.ShouldEqual("Pass", "Fail"); }
public InstanceBehaviorBuilder() { Behavior = new ExecuteCases(); }