Exemple #1
0
        public void DownVote()
        {
            var rating = new Rating(0, 0);

            rating.DownVote();

            Assert.AreEqual(-1, rating.Sum);
        }
Exemple #2
0
        public void UpVoteDownVote_PositiveUpAndDownVote_ReturnsCorrectRating()
        {
            // Arrange
            double expectedResult = 0.6;

            // Act
            rating.UpVote();
            rating.UpVote();
            rating.UpVote();

            rating.DownVote();
            rating.DownVote();
            rating.DownVote();
            rating.DownVote();
            rating.DownVote();

            // Assert
            Assert.AreEqual(expectedResult, rating.CurrentRating);
        }