ajout de la commande de creation de match
This commit was merged in pull request #7.
This commit is contained in:
32
Tests/Giants.Application.Tests/ApplicationTests.cs
Normal file
32
Tests/Giants.Application.Tests/ApplicationTests.cs
Normal 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>();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user