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,32 @@
namespace Giants.Core.Tests;
using Giants.Application;
using Giants.Core.Commands;
using Giants.Core.Interfaces;
using Microsoft.Extensions.DependencyInjection;
public class ApplicationTests
{
[Fact]
public void ApplicationCreationExample()
{
GiantApplication app = new GiantApplication();
}
[Fact]
public void TryingServiceInjection()
{
// creation des instances
IMatchRepository matchRepository = new MatchRepositoryMock();
var serviceCollection = new ServiceCollection();
serviceCollection.AddScoped(repo => matchRepository);
// Ajout des commandes disponibles
serviceCollection.AddScoped<NewMatchCommand>();
//Test d'injection
var serviceProvider = serviceCollection.BuildServiceProvider();
NewMatchCommand? command = serviceProvider.GetService<NewMatchCommand>();
}
}