-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestStatsCalculation.py
More file actions
140 lines (93 loc) · 5.54 KB
/
TestStatsCalculation.py
File metadata and controls
140 lines (93 loc) · 5.54 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
import unittest
from rommee_backend import *
class TestStoneValueCalculation(unittest.TestCase):
def test_simpleStoneVariant_x_6_7(self):
testStone = Stone(5,Color.RED)
area = [testStone, Stone(6,Color.RED),Stone(7,Color.RED)]
self.assertEqual(5,calc_stone_value_in_area(testStone,area),msg="x_6_7")
def test_simpleStoneVariant_5_x_7(self):
testStone = Stone(6,Color.RED)
area = [Stone(5,Color.RED),testStone,Stone(7,Color.RED)]
self.assertEqual(5,calc_stone_value_in_area(testStone,area),msg="5_x_7")
def test_simpleStoneVariant_5_6_x(self):
testStone = Stone(7,Color.RED)
area = [Stone(5,Color.RED),Stone(6,Color.RED),testStone]
self.assertEqual(5,calc_stone_value_in_area(testStone,area),msg="5_6_x")
def test_simpleStoneVariant_x_11_12(self):
testStone = Stone(10,Color.RED)
area = [testStone, Stone(11,Color.RED),Stone(12,Color.RED)]
self.assertEqual(10,calc_stone_value_in_area(testStone,area),msg="x_11_12")
def test_simpleStoneVariant_10_x_12(self):
testStone = Stone(11,Color.RED)
area = [Stone(10,Color.RED),testStone,Stone(712,Color.RED)]
self.assertEqual(10,calc_stone_value_in_area(testStone,area),msg="10_x_12")
def test_simpleStoneVariant_10_11_x(self):
testStone = Stone(12,Color.RED)
area = [Stone(10,Color.RED),Stone(11,Color.RED),testStone]
self.assertEqual(10,calc_stone_value_in_area(testStone,area),msg="10_11_x")
def test_simpleStoneVariant_10_11_x_13(self):
testStone = Stone(12,Color.RED)
area = [Stone(10,Color.RED),Stone(11,Color.RED),testStone,Stone(13,Color.RED)]
self.assertEqual(10,calc_stone_value_in_area(testStone,area),msg="10_11_x_13")
def test_simpleStoneVariant_10_11_13_x_1(self):
testStone = Stone(1,Color.RED)
area = [Stone(10,Color.RED),Stone(11,Color.RED),Stone(13,Color.RED),testStone]
self.assertEqual(10,calc_stone_value_in_area(testStone,area),msg="10_11_13_x_1")
def test_simpleStoneVariant_x_2_3_4(self):
testStone = Stone(1,Color.RED)
area = [testStone,Stone(2,Color.RED),Stone(3,Color.RED),Stone(4,Color.RED)]
self.assertEqual(5,calc_stone_value_in_area(testStone,area),msg="x_2_3_4")
def test_simpleStoneVariant_x_j_3_4(self):
testStone = Stone(1,Color.RED)
area = [testStone, Stone(0,Color.JOKER),Stone(3,Color.RED),Stone(4,Color.RED)]
self.assertEqual(5,calc_stone_value_in_area(testStone,area),msg="x_j_3_4")
def test_simpleStoneVariant_1_2_j_x(self):
testStone = Stone(4,Color.RED)
area = [Stone(1,Color.RED),Stone(2,Color.RED),Stone(0,Color.JOKER),testStone]
self.assertEqual(5,calc_stone_value_in_area(testStone,area),msg="1_2_j_x")
def test_simpleStoneVariant_10_11_j_x(self):
testStone = Stone(12,Color.RED)
area = [Stone(10,Color.RED),Stone(11,Color.RED),Stone(0,Color.JOKER),testStone]
self.assertEqual(10,calc_stone_value_in_area(testStone,area),msg="10_11_j_x")
def test_simpleStoneVariant_8_9_j_x(self):
testStone = Stone(11,Color.RED)
area = [Stone(8,Color.RED),Stone(8,Color.RED),Stone(0,Color.JOKER),testStone]
self.assertEqual(10,calc_stone_value_in_area(testStone,area),msg="8_9_j_x")
def test_simpleStoneVariant_8_9_x_j(self):
testStone = Stone(10,Color.RED)
area = [Stone(8,Color.RED),Stone(9,Color.RED),testStone,Stone(0,Color.JOKER)]
self.assertEqual(10,calc_stone_value_in_area(testStone,area),msg="8_9_x_j")
def test_simpleStoneVariant_7_8_x_j(self):
testStone = Stone(9,Color.RED)
area = [Stone(7,Color.RED),Stone(8,Color.RED),testStone,Stone(0,Color.JOKER)]
self.assertEqual(5,calc_stone_value_in_area(testStone,area),msg="7_8_x_j")
def test_simpleStoneVariant_j_2_j_x(self):
testStone = Stone(4,Color.RED)
area = [Stone(0,Color.JOKER),Stone(2,Color.RED),Stone(0,Color.JOKER),testStone]
self.assertEqual(5,calc_stone_value_in_area(testStone,area),msg="j_2_j_x")
def test_simpleStoneVariant_x_1_1(self):
testStone = Stone(1,Color.RED)
area = [testStone,Stone(1,Color.RED),Stone(1,Color.RED)]
self.assertEqual(25,calc_stone_value_in_area(testStone,area),msg="x_1_1")
def test_simpleStoneVariant_1_x_1(self):
testStone = Stone(1,Color.RED)
area = [Stone(1,Color.RED),testStone,Stone(1,Color.RED)]
self.assertEqual(25,calc_stone_value_in_area(testStone,area),msg="1_x_1")
def test_simpleStoneVariant_1_1_x(self):
testStone = Stone(1, Color.RED)
area = [Stone(1, Color.RED), Stone(1, Color.RED),testStone]
self.assertEqual(25, calc_stone_value_in_area(testStone, area), msg="1_1_x")
def test_simpleStoneVariant_1_1_x_j(self):
testStone = Stone(1, Color.RED)
area = [Stone(1, Color.RED), Stone(1, Color.RED),testStone,Stone(0, Color.JOKER)]
self.assertEqual(25, calc_stone_value_in_area(testStone, area), msg="1_1_x_j")
def test_simpleStoneVariant_1_j_x_j(self):
testStone = Stone(1, Color.RED)
area = [Stone(1, Color.RED), Stone(0, Color.JOKER),testStone,Stone(0, Color.JOKER)]
self.assertEqual(25, calc_stone_value_in_area(testStone, area), msg="1_j_x_j")
def test_simpleStoneVariant_j_x_1_j(self):
testStone = Stone(1, Color.RED)
area = [Stone(0, Color.JOKER),testStone,Stone(1, Color.RED),Stone(0, Color.JOKER)]
self.assertEqual(25, calc_stone_value_in_area(testStone, area), msg="j_x_1_j")
if __name__ == '__main__':
unittest.main()