コード例 #1
0
        public void executing_the_table_grammar_will_execute_the_inner_grammar_for_each_child_row()
        {
            grammar.Execute(step);

            step.LeafFor("record").AllSteps().Each(childStep =>
            {
                inner.AssertWasCalled(x => x.Execute(childStep, null),
                                      x => { x.Constraints(Is.Same(childStep), Is.Anything()); });
            });
        }
コード例 #2
0
        private IControlFactory SetupControlFactoryMockWithExpectationWithDelegate(
            MockRepository mockRepository, string message, string title,
            MessageBoxIcon messageBoxIcon, DialogResult dialogResultToReturn,
            ConfirmationDelegate confirmationDelegate)
        {
            IControlFactory controlFactory = mockRepository.StrictMock <IControlFactory>();

            controlFactory.Expect(
                factory => factory.ShowMessageBox(null, null, MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Asterisk, null))
            .Return(dialogResultToReturn).Constraints(
                Is.Equal(message), Is.Equal(title), Is.Equal(MessageBoxButtons.YesNo),
                Is.Equal(messageBoxIcon), Is.Anything())
            .WhenCalled(invocation => confirmationDelegate(dialogResultToReturn == DialogResult.Yes));
            return(controlFactory);
        }
コード例 #3
0
        protected override void beforeEach()
        {
            suite = StoryTeller.Testing.DataMother.BuildHierarchy(@"
t1,Success
t2,Success
t3,Success
");


            test1 = suite.FindTest("t1");
            test2 = suite.FindTest("t2");
            test3 = suite.FindTest("t3");

            Services.Inject(suite);

            driver1 = MockRepository.GenerateMock <ITestLineDriver>();
            driver2 = MockRepository.GenerateMock <ITestLineDriver>();
            driver3 = MockRepository.GenerateMock <ITestLineDriver>();


            MockFor <ISuiteView>().Expect(x => x.AddTest(null, null)).Constraints(Is.Equal(test1), Is.Anything()).Return(
                driver1);
            MockFor <ISuiteView>().Expect(x => x.AddTest(null, null)).Constraints(Is.Equal(test2), Is.Anything()).Return(
                driver2);
            MockFor <ISuiteView>().Expect(x => x.AddTest(null, null)).Constraints(Is.Equal(test3), Is.Anything()).Return(
                driver3);

            MockFor <ITestService>().Expect(x => x.GetStatus(test1)).Return(TestState.Queued);
            MockFor <ITestExplorer>().Expect(x => x.IconFor(test1)).Return(Icon.Pending);

            MockFor <ITestService>().Expect(x => x.GetStatus(test2)).Return(TestState.NotQueued);
            MockFor <ITestExplorer>().Expect(x => x.IconFor(test2)).Return(Icon.Success);

            MockFor <ITestService>().Expect(x => x.GetStatus(test3)).Return(TestState.NotQueued);
            MockFor <ITestExplorer>().Expect(x => x.IconFor(test3)).Return(Icon.Failed);

            ClassUnderTest.Activate(null);
        }
コード例 #4
0
        protected override void beforeEach()
        {
            suite = new Suite("the suite");
            test  = new Test("test 1");
            suite.AddTest(test);

            Services.Inject(suite);

            driver = MockRepository.GenerateMock <ITestLineDriver>();
            MockFor <ISuiteView>().Expect(x => x.AddTest(test, null)).Constraints(Is.Equal(test), Is.Anything()).Return(
                driver);

            ClassUnderTest.Activate(null);
        }