diff --git a/source/Trek-12/Tests/testBestScore.cs b/source/Trek-12/Tests/testBestScore.cs new file mode 100644 index 0000000..e78457a --- /dev/null +++ b/source/Trek-12/Tests/testBestScore.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Models; + +namespace Tests +{ + public class testBestScore + { + [Fact] + public void TestCstor() + { + BestScore b = new BestScore(12, 456); + Assert.NotNull(b); + Assert.Equal(12, b.GamesPlayed); + Assert.Equal(456, b.Score); + } + + [Fact] + public void TestCstorNotEqual() + { + BestScore b = new BestScore(15, 4656); + Assert.NotNull(b); + Assert.NotEqual(12, b.GamesPlayed); + Assert.NotEqual(456, b.Score); + } + + [Fact] + public void TestIncr() + { + BestScore b = new BestScore(12, 456); + b.IncrGamesPlayed(); + Assert.NotNull(b); + Assert.Equal(13, b.GamesPlayed); + } + + [Fact] + public void TestNotNegative() + { + BestScore b = new BestScore(-4, -98); + Assert.NotNull(b); + Assert.Equal(0, b.GamesPlayed); + Assert.Equal(0, b.Score); + } + } +}