plus simple
This commit was merged in pull request #13.
This commit is contained in:
@@ -17,6 +17,7 @@ public class MatchTesting
|
||||
Match match2 = new Match(getter);
|
||||
match2.AddPlayer("Player1");
|
||||
match2.AddPlayer("Player2");
|
||||
Assert.Throws<MatchConfigException>(() => match2.AddPlayer("Player2"));
|
||||
match2.Init();
|
||||
|
||||
Match match3 = new Match(getter);
|
||||
@@ -51,10 +52,23 @@ public class MatchTesting
|
||||
|
||||
PlayerZone player1 = match.GetPlayerZone("Player1");
|
||||
PlayerZone player1_3 = match.GetPlayerZone("Player2");
|
||||
|
||||
Assert.Equal(3, player1.Ressources[Enums.ResourceType.Piece]);
|
||||
player1.AddRessources(ResourceType.Piece, 1);
|
||||
Assert.Equal(3, player1_3.Ressources[Enums.ResourceType.Piece]);
|
||||
|
||||
Assert.Equal(4, player1.Objectives.Count);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void MatchGetters()
|
||||
{
|
||||
StaticDataGetter getter = new();
|
||||
Match match = new Match(getter);
|
||||
match.AddPlayer("Player1");
|
||||
match.AddPlayer("Player2");
|
||||
match.Init();
|
||||
|
||||
Assert.Throws<ArgumentException>(() => match.GetPlayerZone("UnknownPlayer"));
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
using LittleTown.Core.Actions;
|
||||
using LittleTown.StaticDataAcces;
|
||||
|
||||
namespace LittleTown.Core.Tests;
|
||||
|
||||
public class MatchUpdaterTesting
|
||||
{
|
||||
private class TestAction : IAction
|
||||
{
|
||||
public Action<MatchUpdater> CB { get; init; } = delegate { };
|
||||
|
||||
public void Execute(MatchUpdater updater)
|
||||
{
|
||||
CB(updater);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void EnforcePlayerCountInMatchCreation()
|
||||
{
|
||||
StaticDataGetter getter = new StaticDataGetter();
|
||||
|
||||
Match match = new Match(getter);
|
||||
match.AddPlayer("Player1");
|
||||
match.AddPlayer("Player2");
|
||||
match.Init();
|
||||
|
||||
TestAction ta = new TestAction()
|
||||
{
|
||||
CB = (updater) =>
|
||||
{
|
||||
Assert.True(updater.GetMatch() == match);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user