ajout des la base des batiments
All checks were successful
dotnet package / build (8.0.x) (push) Successful in 2m54s

This commit was merged in pull request #6.
This commit is contained in:
2024-05-31 22:40:36 +02:00
parent c223aed71f
commit 35e046a4bb
9 changed files with 218 additions and 13 deletions

View File

@@ -5,7 +5,7 @@ namespace LittleTown.Core.Tests;
public class BuildingTesting
{
List<Building> _buildings;
ICollection<Building> _buildings;
public BuildingTesting()
{
@@ -17,10 +17,14 @@ public class BuildingTesting
public void TestCosts()
{
Building? b = _buildings.FirstOrDefault(b => b.Name.Equals("Atelier"));
Assert.NotNull(b);
Assert.Equal(2, b.Price[Enums.ResourceType.Rock]);
b = _buildings.FirstOrDefault(b => b.Name == "Bar");
Assert.NotNull(b);
Assert.Equal(2, b.Price[Enums.ResourceType.Cereal]);
Assert.Equal(2, b.Price[Enums.ResourceType.Rock]);
Assert.Equal(12, _buildings.Count(b => b.BeginnerBuilding));
}
}

View File

@@ -1,3 +1,5 @@
using LittleTown.StaticDataAcces;
namespace LittleTown.Core.Tests;
public class MatchTesting
@@ -5,15 +7,16 @@ public class MatchTesting
[Fact]
public void EnforcePlayerCountInMatchCreation()
{
Assert.Throws<ArgumentOutOfRangeException>(() => { new Match(1); });
StaticDataGetter getter = new();
Assert.Throws<ArgumentOutOfRangeException>(() => { new Match(1, getter); });
Match match2Player = new Match(2);
Match match2Player = new Match(2, getter);
Match match3Player = new Match(3);
Match match3Player = new Match(3, getter);
Match match4Player = new Match(4);
Match match4Player = new Match(4, getter);
Assert.Throws<ArgumentOutOfRangeException>(() => { new Match(5); });
Assert.Throws<ArgumentOutOfRangeException>(() => { new Match(5, getter); });
}
[Fact]