using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Models.Game; namespace Tests { public class BestScoreTests { [Fact] public void Constructor_WithNegativeInputs_SetsPropertiesToZero() { var bestScore = new BestScore(-5, -10); Assert.Equal(0, bestScore.GamesPlayed); Assert.Equal(0, bestScore.Score); } [Fact] public void Constructor_WithPositiveInputs_SetsPropertiesCorrectly() { var bestScore = new BestScore(5, 10); Assert.Equal(5, bestScore.GamesPlayed); Assert.Equal(10, bestScore.Score); } [Fact] public void IncrGamesPlayed_IncrementsGamesPlayed() { var bestScore = new BestScore(0, 0); bestScore.IncrGamesPlayed(); Assert.Equal(1, bestScore.GamesPlayed); } [Fact] public void ScoreSetter_WithLowerValue_DoesNotChangeScore() { var bestScore = new BestScore(0, 10); bestScore.UpdateScore(5); Assert.Equal(5, bestScore.Score); } [Fact] public void ScoreSetter_WithHigherValue_ChangesScore() { var bestScore = new BestScore(0, 5); bestScore.UpdateScore(10); Assert.Equal(10, bestScore.Score); } } }