-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathScoreDisplayTest.cs
58 lines (50 loc) · 1.44 KB
/
ScoreDisplayTest.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
56
57
58
using UnityEngine;
using UnityEditor;
using UnityEngine.TestTools;
using NUnit.Framework;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
public class ScoreDisplayTest {
[Test]
public void T00PassingTest() {
// Use the Assert class to test conditions.
Assert.AreEqual(1, 1);
}
[Test]
public void Test01Bowl(){
int[] rolls = {1};
string rollsString = "1";
Assert.AreEqual(rollsString, ScoreDisplay.FormatBowls(rolls.ToList()));
}
[Test]
public void Test02BowlStrike(){
int[] rolls = {10};
string rollsString = "X";
Assert.AreEqual(rollsString, ScoreDisplay.FormatBowls(rolls.ToList()));
}
[Test]
public void Test03BowlSpare(){
int[] rolls = {8, 2};
string rollsString = "/";
Assert.AreEqual(rollsString, ScoreDisplay.FormatBowls(rolls.ToList()));
}
[Test]
public void Test04SpareFrameTen(){
int[] rolls = {1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,9,3};
string rollsString = "1111111111111111111/3";
Assert.AreEqual(rollsString, ScoreDisplay.FormatBowls(rolls.ToList()));
}
[Test]
public void Test05StrikeFrameTen(){
int[] rolls = {1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 10, 1,1};
string rollsString = "111111111111111111X11";
Assert.AreEqual(rollsString, ScoreDisplay.FormatBowls(rolls.ToList()));
}
[Test]
public void Test06ZeroEqualsDash(){
int[] rolls = {0};
string rollsString = "- ";
Assert.AreEqual(rollsString, ScoreDisplay.FormatBowls(rolls.ToList()));
}
}