Esempio n. 1
0
 protected override void setUp()
 {
     ThePresenter.Handle(new TestRunEvent(new Test("another test"), TestState.NotQueued)
     {
         Completed = true
     });
 }
Esempio n. 2
0
        protected override void setUp()
        {
            Services.PartialMockTheClassUnderTest();

            MockFor <ITestService>().Expect(x => x.CreatePreview(theTest)).Return(theHtml);

            ThePresenter.ChangeModeTo(Mode.Preview);
        }
Esempio n. 3
0
        public void update_the_screen_if_the_view_is_in_results_mode()
        {
            ThePresenter.SetMode(Mode.Preview);

            ClassUnderTest.HandleMessage(new ClearResultsMessage());

            MockFor <ITestHeaderViewModel>().AssertWasCalled(x => x.Update());
        }
Esempio n. 4
0
        protected override void setUp()
        {
            ThereIsAPreviousResultForTheTest();
            Services.PartialMockTheClassUnderTest();

            ThePresenter.Expect(x => x.ChangeModeTo(Mode.Results));
            ThePresenter.Start();
        }
Esempio n. 5
0
        protected override void setUp()
        {
            Services.PartialMockTheClassUnderTest();

            MockFor <ITestStateManager>().Expect(x => x.CurrentXml).Return(theXml);

            ThePresenter.ChangeModeTo(Mode.Xml);
        }
        protected override void beforeEach()
        {
            fixture = new FixtureGraph("Math");
            Services.Inject <IFixtureNode>(fixture);


            ThePresenter.Activate(null);
        }
Esempio n. 7
0
        public void change_to_preview_mode_if_the_view_is_in_results_mode()
        {
            ThePresenter.SetMode(Mode.Results);
            ClassUnderTest.Expect(x => x.ChangeModeTo(Mode.Preview));

            ClassUnderTest.HandleMessage(new ClearResultsMessage());

            ClassUnderTest.VerifyAllExpectations();
        }
Esempio n. 8
0
        public void do_nothing_if_it_is_not_the_correct_test()
        {
            ThePresenter.Expect(x => x.ChangeModeTo(Mode.Results)).Repeat.Never();

            ThePresenter.Handle(new TestRunEvent(new Test("different test"), TestState.NotQueued)
            {
                Completed = true
            });

            ThePresenter.AssertWasNotCalled(x => x.ChangeModeTo(Mode.Results));
        }
Esempio n. 9
0
        protected override void setUp()
        {
            ThereIsNoPreviousResultForTheTest();
            theTest.IsEmpty().ShouldBeTrue();

            Services.PartialMockTheClassUnderTest();

            ThePresenter.Expect(x => x.ChangeModeTo(Mode.Preview));

            ThePresenter.Start();
        }
Esempio n. 10
0
        protected override void setUp()
        {
            ThereIsNoPreviousResultForTheTest();
            theTest.Add(new Section("something"));

            Services.PartialMockTheClassUnderTest();

            ThePresenter.Expect(x => x.ChangeModeTo(Mode.Preview));

            ThePresenter.Start();
        }
Esempio n. 11
0
        protected override void setUp()
        {
            Services.PartialMockTheClassUnderTest();

            theTest.LastResult = new TestResult()
            {
                Html = "<html />"
            };

            ThePresenter.ChangeModeTo(Mode.Results);
        }
Esempio n. 12
0
        public void the_available_view_states_should_be()
        {
            ThePresenter.Handle(new TestRunEvent(theTest, TestState.NotQueued)
            {
                Completed = true
            });

            ThePresenter.Modes[Mode.Edit].CanExecute(null).ShouldBeTrue();
            ThePresenter.Modes[Mode.Preview].CanExecute(null).ShouldBeTrue();
            ThePresenter.Modes[Mode.Results].CanExecute(null).ShouldBeFalse();
            ThePresenter.Modes[Mode.Xml].CanExecute(null).ShouldBeTrue();
        }
Esempio n. 13
0
        public void show_results_if_the_correct_test()
        {
            ThePresenter.Expect(x => x.ChangeModeTo(Mode.Results));

            ThePresenter.Handle(new TestRunEvent(theTest, TestState.NotQueued)
            {
                Completed = true
            });

            MockFor <ITestView>().Expect(x => x.MarkNotExecuting());

            ThePresenter.AssertWasCalled(x => x.ChangeModeTo(Mode.Results));
        }
Esempio n. 14
0
 public void do_nothing_if_it_is_a_different_test()
 {
     ThePresenter.Handle(new TestRunEvent(new Test("some other test"), TestState.Queued));
     MockFor <ITestHeaderViewModel>().AssertWasNotCalled(x => x.Update());
 }
Esempio n. 15
0
 public void the_view_should_be_put_into_the_results_mode()
 {
     ThePresenter.AssertWasCalled(x => x.ChangeModeTo(Mode.Results));
 }
Esempio n. 16
0
 protected override void setUp()
 {
     ThePresenter.ChangeModeTo(Mode.Results);
 }
Esempio n. 17
0
 public void should_change_the_status_on_the_view_to_executing_if_it_is_the_correct_test()
 {
     ThePresenter.Handle(new TestRunEvent(theTest, TestState.Executing));
     MockFor <ITestView>().AssertWasCalled(x => x.MarkAsExecuting());
 }
Esempio n. 18
0
 public void do_nothing_if_it_is_a_different_test()
 {
     ThePresenter.Handle(new TestRunEvent(new Test("different test"), TestState.Executing));
     MockFor <ITestView>().AssertWasNotCalled(x => x.MarkAsExecuting());
 }
Esempio n. 19
0
 public void update_the_view_if_the_test_matches()
 {
     ThePresenter.Handle(new TestRunEvent(theTest, TestState.NotQueued));
     MockFor <ITestHeaderViewModel>().AssertWasCalled(x => x.Update());
 }
Esempio n. 20
0
 public void do_nothing_if_the_test_does_not_match()
 {
     ThePresenter.Handle(new TestRunEvent(new Test("other test"), TestState.NotQueued));
     MockFor <ITestHeaderViewModel>().AssertWasNotCalled(x => x.Update());
 }
Esempio n. 21
0
 public void update_the_view_if_it_is_the_correct_test()
 {
     ThePresenter.Handle(new TestRunEvent(theTest, TestState.Queued));
     MockFor <ITestHeaderViewModel>().AssertWasCalled(x => x.Update());
 }