public void Next_Should_Return_Null_When_All_Answered() { // Arrange var mockSpeachService = new Mock <ISpeachService>(); var spellings = new ObservableCollection <SpellingViewModel>(); var s = new Spelling() { Word = "Dog", ContextSentence = "The dog and bone" }; var svm = new SpellingViewModel(s); spellings.Add(svm); var sut = new SpellTestService(spellings, mockSpeachService.Object); var q = sut.NextQuestion(); // Act q = sut.AnswerQuestion("Dog"); // Assert Assert.Null(q); q = sut.NextQuestion(); Assert.Null(q); }
public void WhenIsAnsweredIncorrectlyErrorCountIncreases() { // Arrange var mockSpeachService = new Mock <ISpeachService>(); var spellings = new ObservableCollection <SpellingViewModel>(); var s = new Spelling() { Word = "Dog", ContextSentence = "The dog and bone" }; var svm = new SpellingViewModel(s); spellings.Add(svm); var sut = new SpellTestService(spellings, mockSpeachService.Object); sut.NextQuestion(); // Act sut.AnswerQuestion("Dogg"); // Assert Assert.Equal(svm.CorrectCount, 0); Assert.Equal(svm.ErrorCount, 1); Assert.Equal(svm.Skipped, false); }