From c45dcdda68acb05618b82e6f87b895ee75c5ce4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi?= Date: Sat, 13 Apr 2024 08:42:10 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=20de=20plusieurs=20tests=20BestScore=20do?= =?UTF-8?q?nt=20un=20provisoirement=20faux=F0=9F=9A=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/Trek-12/Tests/testBestScore.cs | 48 +++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 source/Trek-12/Tests/testBestScore.cs 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); + } + } +}