From a696163accb7e6d850a9bcf9a9d1580267cef9de Mon Sep 17 00:00:00 2001 From: Ali Yousefi Date: Thu, 15 Feb 2024 21:01:35 +0330 Subject: [PATCH] Fix test cases --- .../Fixtures/BaseFixture.cs | 3 +++ .../Fixtures/ServiceProviderFixture.cs | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/CSharp/EasyMicroservices.Cores.AspCore.Tests/Fixtures/BaseFixture.cs b/src/CSharp/EasyMicroservices.Cores.AspCore.Tests/Fixtures/BaseFixture.cs index ad1dd20..bf5228c 100644 --- a/src/CSharp/EasyMicroservices.Cores.AspCore.Tests/Fixtures/BaseFixture.cs +++ b/src/CSharp/EasyMicroservices.Cores.AspCore.Tests/Fixtures/BaseFixture.cs @@ -4,10 +4,12 @@ using EasyMicroservices.Cores.Database.Interfaces; using EasyMicroservices.Cores.Database.Logics; using EasyMicroservices.Cores.Database.Managers; +using EasyMicroservices.Cores.Interfaces; using EasyMicroservices.Cores.Models; using EasyMicroservices.Cores.Relational.EntityFrameworkCore.Intrerfaces; using EasyMicroservices.Cores.Tests.DatabaseLogics.Database.Contexts; using EasyMicroservices.Cores.Tests.Fixtures; +using EasyMicroservices.Cores.Widgets; namespace EasyMicroservices.Cores.AspCore.Tests.Fixtures; @@ -21,6 +23,7 @@ public static async Task Init(int port, int? whiteLabelPort, A app.Services.AddTransient(serviceProvider => new MyTestContext(serviceProvider.GetService())); app.Services.AddTransient(); app.Services.AddSingleton(service => new WhiteLabelManager(service)); + app.Services.AddSingleton(); app.Services.AddSingleton(); app.Services.AddSingleton((provider) => { diff --git a/src/CSharp/EasyMicroservices.Cores.Tests/Fixtures/ServiceProviderFixture.cs b/src/CSharp/EasyMicroservices.Cores.Tests/Fixtures/ServiceProviderFixture.cs index ec41e1c..54072d8 100644 --- a/src/CSharp/EasyMicroservices.Cores.Tests/Fixtures/ServiceProviderFixture.cs +++ b/src/CSharp/EasyMicroservices.Cores.Tests/Fixtures/ServiceProviderFixture.cs @@ -10,6 +10,7 @@ using EasyMicroservices.Cores.Relational.EntityFrameworkCore.Intrerfaces; using EasyMicroservices.Cores.Tests.Database; using EasyMicroservices.Cores.Tests.DatabaseLogics.Database.Contexts; +using EasyMicroservices.Cores.Widgets; using Microsoft.Extensions.DependencyInjection; namespace EasyMicroservices.Cores.Tests.Fixtures @@ -32,6 +33,7 @@ public async Task InitializeAsync() serviceCollection.AddTransient(serviceProvider => new MyTestContext(serviceProvider.GetService())); serviceCollection.AddTransient(); serviceCollection.AddSingleton(service => new WhiteLabelManager(service)); + serviceCollection.AddSingleton(); serviceCollection.AddSingleton(); serviceCollection.AddSingleton((provider) => {