コード例 #1
0
ファイル: ExecuteCasesTests.cs プロジェクト: kmcginnes/fixie
        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");
        }
コード例 #2
0
ファイル: ExecuteCasesTests.cs プロジェクト: ridecar2/fixie
        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");
        }
コード例 #3
0
 public InstanceBehaviorBuilder()
 {
     Behavior = new ExecuteCases();
 }