forked from overengineering/sharpasonne
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a rule and a game action and some tests.
- Loading branch information
Lee Richardson
committed
Jan 3, 2018
1 parent
7ab8e92
commit 7f0f997
Showing
5 changed files
with
63 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using Sharpasonne.GameActions; | ||
using Sharpasonne.Rules; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Collections.Immutable; | ||
using Xunit; | ||
|
||
namespace Sharpasonne.Tests.Rules | ||
{ | ||
public class SpaceIsEmptyRuleTests | ||
{ | ||
[Fact] | ||
public void When_TileIsEmpty_Then_True() | ||
{ | ||
Assert.True(new SpaceIsEmptyRule().Verify(new Engine(), new PlaceTileGameAction())); | ||
} | ||
|
||
[Fact] | ||
public void When_TileIsEmpty_Then_False() | ||
{ | ||
var engine = new Engine(); | ||
|
||
Assert.True(new SpaceIsEmptyRule().Verify(engine, new PlaceTileGameAction())); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using Sharpasonne; | ||
using Sharpasonne.Models; | ||
|
||
namespace Sharpasonne.GameActions | ||
{ | ||
public class PlaceTileGameAction : IGameAction | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace Sharpasonne | ||
{ | ||
public interface IGameAction | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using Sharpasonne; | ||
using Sharpasonne.Models; | ||
|
||
namespace Sharpasonne.Rules | ||
{ | ||
public class SpaceIsEmptyRule : IRule | ||
{ | ||
public bool Verify<T>(Engine engine, T gameAction) | ||
where T : IGameAction | ||
{ | ||
return true; | ||
} | ||
} | ||
} |