using BotSharp.Abstraction.Conversations; using BotSharp.Abstraction.MLTasks; using BotSharp.Abstraction.VectorStorage; using BotSharp.Plugin.SemanticKernel.UnitTests.Helpers; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.SemanticKernel; using Moq; namespace BotSharp.Plugin.SemanticKernel.Tests { public class SemanticKernelPluginTests { [Fact] public void TestRegisterDI() { var services = new ServiceCollection(); var config = new ConfigurationBuilder().Build(); services.AddSingleton(config); var plugin = new SemanticKernelPlugin(); services.AddScoped(x => Mock.Of()); services.AddScoped(x => Mock.Of()); #pragma warning disable SKEXP0003 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. services.AddScoped(x => Mock.Of()); #pragma warning restore SKEXP0003 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. #pragma warning disable SKEXP0001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. services.AddScoped(x => Mock.Of()); #pragma warning restore SKEXP0001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. services.AddScoped(x => Mock.Of()); plugin.RegisterDI(services, config); var provider = services.BuildServiceProvider().CreateScope().ServiceProvider; Assert.NotNull(provider.GetService()); Assert.NotNull(provider.GetService()); Assert.NotNull(provider.GetService()); Assert.NotNull(provider.GetService()); } } }