public void CanSuggest(bool expected, double score) { var movieScore = new MovieScoreStub(score); var movieSuggestion = new MovieSuggestion(movieScore); var title = Guid.NewGuid().ToString(); var isGood = movieSuggestion.IsGoodMovie(title); Assert.Equal(isGood, expected); }
public void CanSuggest(bool expected, double score) { var movieScore = new Mock <IMovieScore>(); movieScore.Setup(ms => ms.Score(It.IsAny <string>())).Returns(score); var movieSuggestion = new MovieSuggestion(movieScore.Object); var title = Guid.NewGuid().ToString(); var isGood = movieSuggestion.IsGoodMovie(title); Assert.Equal(expected, isGood); movieScore.Verify(ms => ms.Score(title)); }
public void CanSuggest(bool expected, double score) { var movieScore = A.Fake <IMovieScore>(); A.CallTo(() => movieScore.Score(A <string> .Ignored)).Returns(score); var movieSuggestion = new MovieSuggestion(movieScore); var title = Guid.NewGuid().ToString(); var isGood = movieSuggestion.IsGoodMovie(title); Assert.Equal(expected, isGood); A.CallTo(() => movieScore.Score(title)).MustHaveHappened(); }
public void CanSuggest(bool expected, double score) { var movieScore = Substitute.For <IMovieScore>(); movieScore.Score(Arg.Any <string>()).Returns(score); var movieSuggestion = new MovieSuggestion(movieScore); var title = Guid.NewGuid().ToString(); var isGood = movieSuggestion.IsGoodMovie(title); Assert.Equal(expected, isGood); movieScore.When(ms => ms.Score(title)); }