File tree Expand file tree Collapse file tree 3 files changed +70
-1
lines changed
MattEland.Emergence.Tests Expand file tree Collapse file tree 3 files changed +70
-1
lines changed Original file line number Diff line number Diff line change
1
+ using MattEland . Emergence . Engine ;
2
+ using MattEland . Emergence . Engine . Model ;
3
+ using MattEland . Emergence . Engine . Model . EngineDefinitions ;
4
+ using NUnit . Framework ;
5
+ using Shouldly ;
6
+
7
+ namespace MattEland . Emergence . Tests
8
+ {
9
+ public class GameManagerTests
10
+ {
11
+ [ Test ]
12
+ public void StartingGameManagerShouldReturnMessages ( )
13
+ {
14
+ // Arrange
15
+ var manager = new GameManager ( ) ;
16
+
17
+ // Act
18
+ var messages = manager . Start ( ) ;
19
+
20
+ // Assert
21
+ messages . ShouldNotBeNull ( ) ;
22
+ messages . ShouldNotBeEmpty ( ) ;
23
+ }
24
+
25
+ [ Test ]
26
+ public void StartingGameManagerShouldResultInStartedState ( )
27
+ {
28
+ // Arrange
29
+ var manager = new GameManager ( ) ;
30
+
31
+ // Act
32
+ manager . Start ( ) ;
33
+
34
+ // Assert
35
+ manager . State . ShouldBe ( GameStatus . Ready ) ;
36
+ }
37
+
38
+ [ Theory ]
39
+ [ TestCase ( MoveDirection . Up ) ]
40
+ [ TestCase ( MoveDirection . Right ) ]
41
+ [ TestCase ( MoveDirection . Down ) ]
42
+ [ TestCase ( MoveDirection . Left ) ]
43
+ public void GameManagerShouldRespondToMovesWithMessages ( MoveDirection direction )
44
+ {
45
+ // Arrange
46
+ var manager = new GameManager ( ) ;
47
+ manager . Start ( ) ;
48
+
49
+ // Act
50
+ var messages = manager . MovePlayer ( direction ) ;
51
+
52
+ // Assert
53
+ messages . ShouldNotBeNull ( ) ;
54
+ messages . ShouldNotBeEmpty ( ) ;
55
+ }
56
+
57
+ [ Test ]
58
+ public void GameManagerShouldStartNotStarted ( )
59
+ {
60
+ // Arrange
61
+ var manager = new GameManager ( ) ;
62
+
63
+ // Assert
64
+ manager . State . ShouldBe ( GameStatus . NotStarted ) ;
65
+ }
66
+
67
+ }
68
+ }
Original file line number Diff line number Diff line change 66
66
<Reference Include =" System.Core" />
67
67
</ItemGroup >
68
68
<ItemGroup >
69
+ <Compile Include =" GameManagerTests.cs" />
69
70
<Compile Include =" GameServiceTests.cs" />
70
71
<Compile Include =" Properties\AssemblyInfo.cs" />
71
72
</ItemGroup >
Original file line number Diff line number Diff line change 1
1
SonarScanner.MSBuild.exe begin /k:" IntegerMan_EmergenceWin" /o:" integerman-github" /d:sonar.host.url=" https://sonarcloud.io" /d:sonar.login=" b7b4509740d666b273996bbc0f691e8b897b80d8" /d:sonar.cs.nunit.reportsPaths=" %CD% \NUnitResults.xml" /d:sonar.cs.opencover.reportsPaths=" %CD% \opencover.xml"
2
2
" C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MsBuild.exe" /t:Rebuild
3
3
4
- OpenCover.Console.exe -output:" %CD% \opencover.xml" -register:user -target:" C:\Users\Matt\.nuget\packages\nunit.consolerunner\3.10.0\tools\ nunit3-console.exe" -targetargs:" %CD% \MattEland.Emergence.Tests\bin\Debug\MattEland.Emergence.Tests.dll --result=%CD% \NUnitResults.xml"
4
+ OpenCover.Console.exe -output:" %CD% \opencover.xml" -register:user -target:" nunit3-console.exe" -targetargs:" %CD% \MattEland.Emergence.Tests\bin\Debug\MattEland.Emergence.Tests.dll --result=%CD% \NUnitResults.xml"
5
5
6
6
SonarScanner.MSBuild.exe end /d:sonar.login=" b7b4509740d666b273996bbc0f691e8b897b80d8"
7
7
Pause
You can’t perform that action at this time.
0 commit comments