-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRulesTests.cpp
More file actions
44 lines (35 loc) · 1.03 KB
/
RulesTests.cpp
File metadata and controls
44 lines (35 loc) · 1.03 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
#include "stdafx.h"
#include "CppUnitTest.h"
#include "RulesChecker.h"
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
namespace GameOfLife
{
TEST_CLASS(RulesTests)
{
public:
TEST_METHOD(AliveCellDiesWithMoreThan3AliveNeighbors)
{
Assert::AreEqual(State::DEAD, RulesChecker::getNextState(State::ALIVE, 4));
}
TEST_METHOD(AliveCellDiesWithLessThan2AliveNeighbors)
{
Assert::AreEqual(State::DEAD, RulesChecker::getNextState(State::ALIVE, 1));
}
TEST_METHOD(AliveCellSurviveWith2AliveNeighbors)
{
Assert::AreEqual(State::ALIVE, RulesChecker::getNextState(State::ALIVE, 2));
}
TEST_METHOD(AliveCellSurviveWith3AliveNeighbors)
{
Assert::AreEqual(State::ALIVE, RulesChecker::getNextState(State::ALIVE, 3));
}
TEST_METHOD(DeadCellKeepsDeadWith2AliveNeighbors)
{
Assert::AreEqual(State::DEAD, RulesChecker::getNextState(State::DEAD, 2));
}
TEST_METHOD(DeadCellResurrectWith3AliveNeighbors)
{
Assert::AreEqual(State::ALIVE, RulesChecker::getNextState(State::DEAD, 3));
}
};
}