1 Commits

Author SHA1 Message Date
7b00a91580 ajout de la commande de creation de match 2025-03-12 23:33:10 +01:00
4 changed files with 66 additions and 12 deletions

View File

@@ -15,6 +15,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Giants.Infrastructure", "Sr
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Giants.Application", "Src\Giants.Application\Giants.Application.csproj", "{1EF04517-2D31-4130-A687-7954A5431312}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Giants.Application.Tests", "Tests\Giants.Application.Tests\Giants.Application.Tests.csproj", "{7A23A70F-68C9-4463-A980-E7597A621FDD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -40,11 +42,16 @@ Global
{1EF04517-2D31-4130-A687-7954A5431312}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1EF04517-2D31-4130-A687-7954A5431312}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1EF04517-2D31-4130-A687-7954A5431312}.Release|Any CPU.Build.0 = Release|Any CPU
{7A23A70F-68C9-4463-A980-E7597A621FDD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7A23A70F-68C9-4463-A980-E7597A621FDD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7A23A70F-68C9-4463-A980-E7597A621FDD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7A23A70F-68C9-4463-A980-E7597A621FDD}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{A7B8B752-2AE9-4FB2-8F51-733F96C4CFD0} = {824D17BD-3CFE-498A-967D-3F42DF5EE92D}
{30032CBC-0B7B-4BF3-9682-C506460F0FE6} = {F34871C1-07BB-4012-A310-3FFDD6DC7DBA}
{E6B2C76F-9CE2-4ADA-97F9-CEE24D48B65F} = {824D17BD-3CFE-498A-967D-3F42DF5EE92D}
{1EF04517-2D31-4130-A687-7954A5431312} = {824D17BD-3CFE-498A-967D-3F42DF5EE92D}
{7A23A70F-68C9-4463-A980-E7597A621FDD} = {F34871C1-07BB-4012-A310-3FFDD6DC7DBA}
EndGlobalSection
EndGlobal

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>();
}
}

View File

@@ -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>

View File

@@ -1,12 +0,0 @@
namespace Giants.Core.Tests;
using Giants.Application;
public class ApplicationTests
{
[Fact]
public void ApplicationCreationExample()
{
GiantApplication app = new GiantApplication();
}
}