11using BotSharp . Abstraction . Conversations ;
22using BotSharp . Abstraction . MLTasks ;
3+ using BotSharp . Abstraction . VectorStorage ;
4+ using BotSharp . Plugin . SemanticKernel . UnitTests . Helpers ;
35using Microsoft . Extensions . Configuration ;
46using Microsoft . Extensions . DependencyInjection ;
57using Microsoft . SemanticKernel ;
@@ -15,21 +17,21 @@ public void TestRegisterDI()
1517 var services = new ServiceCollection ( ) ;
1618 var config = new ConfigurationBuilder ( ) . Build ( ) ;
1719 var plugin = new SemanticKernelPlugin ( ) ;
18- services . AddScoped ( x =>
19- {
20- return new KernelBuilder ( )
21- . WithAzureOpenAIChatCompletionService ( "test" , "test" , "test" )
22- . Build ( ) ;
23- } ) ;
24- services . AddScoped < ITokenStatistics > ( x=> Mock . Of < ITokenStatistics > ( ) ) ;
20+ services . AddScoped ( x => Mock . Of < Microsoft . SemanticKernel . AI . TextCompletion . ITextCompletion > ( ) ) ;
21+ services . AddScoped ( x => Mock . Of < Microsoft . SemanticKernel . AI . ChatCompletion . IChatCompletion > ( ) ) ;
22+ services . AddScoped ( x => Mock . Of < Microsoft . SemanticKernel . Memory . IMemoryStore > ( ) ) ;
23+ services . AddScoped ( x => Mock . Of < Microsoft . SemanticKernel . AI . Embeddings . ITextEmbeddingGeneration > ( ) ) ;
24+ services . AddScoped ( x => Mock . Of < ITokenStatistics > ( ) ) ;
2525
2626
2727 plugin . RegisterDI ( services , config ) ;
2828
29- var provider = services . BuildServiceProvider ( ) ;
29+ var provider = services . BuildServiceProvider ( ) . CreateScope ( ) . ServiceProvider ;
3030
3131 Assert . NotNull ( provider . GetService < ITextCompletion > ( ) ) ;
3232 Assert . NotNull ( provider . GetService < IChatCompletion > ( ) ) ;
33+ Assert . NotNull ( provider . GetService < IVectorDb > ( ) ) ;
34+ Assert . NotNull ( provider . GetService < ITextEmbedding > ( ) ) ;
3335 }
3436 }
3537}
0 commit comments