Beispiel #1
0
        public void StartRunsTheFirstStep()
        {
            Mock <IStoryBoardStep> step1 = new Mock <IStoryBoardStep>();
            Mock <IStoryBoardStep> step2 = new Mock <IStoryBoardStep>();

            IStoryBoard board = new StoryBoardBase();

            board.RegisterStep(step1.Object);
            board.RegisterStep(step2.Object);

            board.Start();

            step1.Verify(x => x.Run(), Times.Once);
            step2.Verify(x => x.Run(), Times.Never);
        }
Beispiel #2
0
        public void ContinuesWithRunsCorrectStep()
        {
            Mock <IStoryBoardStep> step1 = new Mock <IStoryBoardStep>();

            step1.SetupGet(x => x.Id).Returns(StepId.Step1);
            Mock <IStoryBoardStep> step2 = new Mock <IStoryBoardStep>();

            step2.SetupGet(x => x.Id).Returns(StepId.Step2);

            IStoryBoard board = new StoryBoardBase();

            board.RegisterStep(step1.Object);
            board.RegisterStep(step2.Object);

            board.ContinueWith(StepId.Step2);

            step1.Verify(x => x.Run(), Times.Never);
            step2.Verify(x => x.Run(), Times.Once);
        }