-
Notifications
You must be signed in to change notification settings - Fork 0
/
JoueurTests.cs
55 lines (46 loc) · 1.67 KB
/
JoueurTests.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
using Microsoft.VisualStudio.TestTools.UnitTesting;
using PROJET_ALGO;
using System.Diagnostics;
namespace GameTests
{
[TestClass]
public class JoueurTests
{
[TestMethod]
public void PlayerName()
{
Joueur test = new Joueur("test");
Assert.AreEqual("test", test.Name, "Name is incorrect");
test.Name = "testupdated";
Assert.AreEqual("testupdated", test.Name, "Name is incorrect");
}
[TestMethod]
public void PlayerAddScore()
{
Joueur test = new Joueur("test");
test.Add_Score(15);
Assert.AreEqual(15, test.Score, "Score is incorrect");
test.Score = 40;
Assert.AreEqual(40, test.Score, "Score is incorrect");
}
[TestMethod]
public void PlayerFoundWords()
{
Joueur test = new Joueur("test");
test.Add_Mot("PLAYER");
test.Add_Mot("THIS_IS_A_TEST");
Assert.AreEqual("PLAYER", test.MotsTrouves[0], "The Word found is incorrect");
Assert.AreEqual("THIS_IS_A_TEST", test.MotsTrouves[1], "The Word found is incorrect");
}
[TestMethod]
public void PlayerToString()
{
Joueur test = new Joueur("test");
test.Add_Mot("PLAYER");
test.Add_Mot("THIS_IS_A_TEST");
test.Score = 70;
string expectedOutput = "Joueur : test\nScore : 70\nListe des mots trouvés : PLAYER THIS_IS_A_TEST ";
Assert.AreEqual(expectedOutput, test.ToString(), "The method ToString is incorrect");
}
}
}