ajout de la commande de creation de match

This commit was merged in pull request #7.
This commit is contained in:
2025-03-12 22:46:41 +01:00
parent f400674c1a
commit 7b00a91580
11 changed files with 199 additions and 14 deletions

View File

@@ -0,0 +1,34 @@
namespace Giants.Core.Tests;
using Giants.Application;
using Giants.Core.Commands;
using Giants.Core.Interfaces;
public class NewMatchCommandTest
{
private readonly IMatchRepository _repo = new MatchRepositoryMock();
[Fact]
public void CreateBasicMatch()
{
NewMatchCommand command = new NewMatchCommand(_repo);
NewMatchResult result = command.Execute();
Assert.True(result.Success);
}
[Fact]
public void TwoNewMatchShouldHaveDifferentID()
{
NewMatchCommand command = new NewMatchCommand(_repo);
NewMatchResult result = command.Execute();
Assert.True(result.Success);
Assert.NotNull(result.Match);
NewMatchCommand command2 = new NewMatchCommand(_repo);
NewMatchResult result2 = command2.Execute();
Assert.True(result2.Success);
Assert.NotNull(result2.Match);
Assert.NotEqual(result.Match.Id, result2.Match.Id);
}
}