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);
        }
Exemple #2
0
        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));
        }
Exemple #3
0
        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();
        }
Exemple #4
0
        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));
        }