public void NextWord_AnswereIsCorrect_WhenAnswereWithoutInfinitive()
        {
            // Arrange
            var view  = Substitute.For <IExerciseView>();
            var words = new List <Word> {
                new Word {
                    TextFrom = "vchytu", TextTo = "to learn"
                }
            };
            var service = new LearnWordService(view, words);

            view.Answer.Returns("learn");

            // Act
            service.NextWord();

            // Assert
            view.IsAnswereCorrect.Should().BeTrue();
        }
        public void NextWord_ResultIsCorrect_WhenUserPutCorrectAnswer(string answer, string userAnswer)
        {
            // Arrange
            var view  = Substitute.For <IExerciseView>();
            var words = new List <Word> {
                new Word {
                    TextFrom = "worde1", TextTo = answer
                }
            };
            var service = new LearnWordService(view, words);

            view.Answer.Returns(userAnswer);

            // Act
            service.NextWord();

            // Assert
            view.IsAnswereCorrect.Should().BeTrue();
        }
        public void NextWord_DoNotRemoveTo_WhenWordIsFinishedInTo()
        {
            // Arrange
            var view  = Substitute.For <IExerciseView>();
            var words = new List <Word> {
                new Word {
                    TextFrom = "ity na", TextTo = "go to"
                }
            };
            var service = new LearnWordService(view, words);

            view.Answer.Returns("go to");

            // Act
            service.NextWord();

            // Assert
            view.IsAnswereCorrect.Should().BeTrue();
        }
Exemple #4
0
 private void btnNext_Click(object sender, EventArgs e)
 {
     Service.NextWord();
 }