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>();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="coverlet.collector" Version="6.0.2" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.3" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
|
||||
<PackageReference Include="xunit" Version="2.9.2" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Using Include="Xunit" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Src\Giants.Application\Giants.Application.csproj" />
|
||||
<ProjectReference Include="..\..\Src\Giants.Core\Giants.Core.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user