Mise en place des MatchCommand
All checks were successful
check main state / build (9.0.x) (push) Successful in 1m28s
All checks were successful
check main state / build (9.0.x) (push) Successful in 1m28s
Ajout des données dynamiques au match
This commit was merged in pull request #21.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using Giants.Core.Enums;
|
||||
using Giants.Core.Interfaces;
|
||||
using Giants.Infrastructure;
|
||||
|
||||
@@ -43,4 +44,12 @@ public class BoardLayoutTests
|
||||
}
|
||||
Assert.Equal(3, test.Count);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CheckIndexToEnum()
|
||||
{
|
||||
IHexagonalGrid grid = new HexagonalGridImpl();
|
||||
BoardLayout layout = new BoardLayout(grid);
|
||||
Assert.Equal(PiecePosition.tile144, layout.FromTileIndex(144));
|
||||
}
|
||||
}
|
||||
34
Tests/Giants.Core.Tests/Entities/MatchTests.cs
Normal file
34
Tests/Giants.Core.Tests/Entities/MatchTests.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System.Reflection;
|
||||
using Giants.Application;
|
||||
using Giants.Core.Interfaces;
|
||||
using Giants.Infrastructure;
|
||||
|
||||
namespace Giants.Core.Tests;
|
||||
|
||||
public class MatchTests
|
||||
{
|
||||
|
||||
private readonly IMatchRepository _repo;
|
||||
|
||||
public MatchTests()
|
||||
{
|
||||
IHexagonalGrid _grid = new HexagonalGridImpl();
|
||||
BoardLayout layout = new BoardLayout(_grid);
|
||||
_repo = new MatchRepositoryMock(layout);
|
||||
|
||||
var match1 = _repo.CreateMatch();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void MatchClone()
|
||||
{
|
||||
Match? match = _repo.CreateMatch();
|
||||
Assert.NotNull(match);
|
||||
|
||||
match.AssignPiece(Enums.PieceIndex.StartPlayer, Enums.PiecePosition.player1Visible);
|
||||
|
||||
Match clone = match.Clone();
|
||||
|
||||
Assert.Equal(clone, match);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user