示例#1
0
 protected override void setUp()
 {
     ThePresenter.Handle(new TestRunEvent(new Test("another test"), TestState.NotQueued)
     {
         Completed = true
     });
 }
示例#2
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));
        }
示例#3
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();
        }
示例#4
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));
        }
示例#5
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());
 }
示例#6
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());
 }
示例#7
0
 public void update_the_view_if_the_test_matches()
 {
     ThePresenter.Handle(new TestRunEvent(theTest, TestState.NotQueued));
     MockFor <ITestHeaderViewModel>().AssertWasCalled(x => x.Update());
 }
示例#8
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());
 }
示例#9
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());
 }
示例#10
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());
 }