Пример #1
0
        public void VerifyScannedSteps()
        {
            _typeWithoutAttribute = new TypeWithoutAttribute();
            _steps = new DefaultMethodNameStepScanner().Scan(TestContext.GetContext(_typeWithoutAttribute)).ToList();
            int stepIndex = 0;

            Assert.That(_steps.Count, Is.EqualTo(24));
            AssertStep(_steps[stepIndex++], "Establish context", ExecutionOrder.Initialize, false, false);
            AssertStep(_steps[stepIndex++], "Setup", ExecutionOrder.Initialize, false, false);
            AssertStep(_steps[stepIndex++], "Given some state", ExecutionOrder.SetupState);
            AssertStep(_steps[stepIndex++], "And another state", ExecutionOrder.ConsecutiveSetupState);
            AssertStep(_steps[stepIndex++], "And Some OTHER state", ExecutionOrder.ConsecutiveSetupState);
            AssertStep(_steps[stepIndex++], "And some other initial state", ExecutionOrder.ConsecutiveSetupState);
            AssertStep(_steps[stepIndex++], "But some initial state is not set", ExecutionOrder.ConsecutiveSetupState);
            AssertStep(_steps[stepIndex++], "But Some OTHER state is not set", ExecutionOrder.ConsecutiveSetupState);
            AssertStep(_steps[stepIndex++], "When something happens", ExecutionOrder.Transition);
            AssertStep(_steps[stepIndex++], "And something else happens", ExecutionOrder.ConsecutiveTransition);
            AssertStep(_steps[stepIndex++], "And another THING Happens", ExecutionOrder.ConsecutiveTransition);
            AssertStep(_steps[stepIndex++], "But something does not happen", ExecutionOrder.ConsecutiveTransition);
            AssertStep(_steps[stepIndex++], "But another THING does not happen", ExecutionOrder.ConsecutiveTransition);
            AssertStep(_steps[stepIndex++], "Then something is true", ExecutionOrder.Assertion, true);
            AssertStep(_steps[stepIndex++], "And another thing is true", ExecutionOrder.ConsecutiveAssertion, true);
            AssertStep(_steps[stepIndex++], "And something else too", ExecutionOrder.ConsecutiveAssertion, true);
            AssertStep(_steps[stepIndex++], "And YET another thing", ExecutionOrder.ConsecutiveAssertion, true);
            AssertStep(_steps[stepIndex++], "And something else", ExecutionOrder.ConsecutiveAssertion, true);
            AssertStep(_steps[stepIndex++], "And there was that one time", ExecutionOrder.ConsecutiveAssertion, true);
            AssertStep(_steps[stepIndex++], "But some condition is not true", ExecutionOrder.ConsecutiveAssertion, true);
            AssertStep(_steps[stepIndex++], "But some other condition is not true", ExecutionOrder.ConsecutiveAssertion, true);
            AssertStep(_steps[stepIndex++], "But some other condition is not true either", ExecutionOrder.ConsecutiveAssertion, true);
            AssertStep(_steps[stepIndex++], "But again some condition is not true", ExecutionOrder.ConsecutiveAssertion, true);
            AssertStep(_steps[stepIndex++], "Tear down", ExecutionOrder.TearDown, asserts: false, shouldReport: false);
        }
 public void VerifyScannedSteps()
 {
     _typeWithoutAttribute = new TypeWithoutAttribute();
     _steps = new DefaultMethodNameStepScanner().Scan(TestContext.GetContext(_typeWithoutAttribute)).ToList();
     int stepIndex = 0;
 
     Assert.That(_steps.Count, Is.EqualTo(24));
     AssertStep(_steps[stepIndex++], "Establish context", ExecutionOrder.Initialize, false, false);
     AssertStep(_steps[stepIndex++], "Setup", ExecutionOrder.Initialize, false, false);
     AssertStep(_steps[stepIndex++], "Given some state", ExecutionOrder.SetupState);
     AssertStep(_steps[stepIndex++], "And another state", ExecutionOrder.ConsecutiveSetupState);
     AssertStep(_steps[stepIndex++], "And Some OTHER state", ExecutionOrder.ConsecutiveSetupState);
     AssertStep(_steps[stepIndex++], "And some other initial state", ExecutionOrder.ConsecutiveSetupState);
     AssertStep(_steps[stepIndex++], "But some initial state is not set", ExecutionOrder.ConsecutiveSetupState);
     AssertStep(_steps[stepIndex++], "But Some OTHER state is not set", ExecutionOrder.ConsecutiveSetupState);
     AssertStep(_steps[stepIndex++], "When something happens", ExecutionOrder.Transition);
     AssertStep(_steps[stepIndex++], "And something else happens", ExecutionOrder.ConsecutiveTransition);
     AssertStep(_steps[stepIndex++], "And another THING Happens", ExecutionOrder.ConsecutiveTransition);
     AssertStep(_steps[stepIndex++], "But something does not happen", ExecutionOrder.ConsecutiveTransition);
     AssertStep(_steps[stepIndex++], "But another THING does not happen", ExecutionOrder.ConsecutiveTransition);
     AssertStep(_steps[stepIndex++], "Then something is true", ExecutionOrder.Assertion, true);
     AssertStep(_steps[stepIndex++], "And another thing is true", ExecutionOrder.ConsecutiveAssertion, true);
     AssertStep(_steps[stepIndex++], "And something else too", ExecutionOrder.ConsecutiveAssertion, true);
     AssertStep(_steps[stepIndex++], "And YET another thing", ExecutionOrder.ConsecutiveAssertion, true);
     AssertStep(_steps[stepIndex++], "And something else", ExecutionOrder.ConsecutiveAssertion, true);
     AssertStep(_steps[stepIndex++], "And there was that one time", ExecutionOrder.ConsecutiveAssertion, true);
     AssertStep(_steps[stepIndex++], "But some condition is not true", ExecutionOrder.ConsecutiveAssertion, true);
     AssertStep(_steps[stepIndex++], "But some other condition is not true", ExecutionOrder.ConsecutiveAssertion, true);
     AssertStep(_steps[stepIndex++], "But some other condition is not true either", ExecutionOrder.ConsecutiveAssertion, true);
     AssertStep(_steps[stepIndex++], "But again some condition is not true", ExecutionOrder.ConsecutiveAssertion, true);
     AssertStep(_steps[stepIndex++], "Tear down", ExecutionOrder.TearDown, asserts:false, shouldReport:false);
 }
 public void Setup()
 {
     _typeWithoutAttribute = new TypeWithoutAttribute();
     _steps = new DefaultMethodNameStepScanner().Scan(TestContext.GetContext(_typeWithoutAttribute)).ToList();
 }
 public void Setup()
 {
     _typeWithoutAttribute = new TypeWithoutAttribute();
     _steps = new DefaultMethodNameStepScanner().Scan(_typeWithoutAttribute).ToList();
 }