mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
.NET: [BREAKING] Add GetService for AIContextProviders and ChatMessageStore (#874)
* Add GetService for AIContextProviders and ChatMessageStore * Change styling and fix format issues * Update sample code to allow for missing memory component.
This commit is contained in:
committed by
GitHub
Unverified
parent
ae018ca4d9
commit
bd61e5f411
+16
@@ -131,6 +131,22 @@ public class InMemoryAgentThreadTests
|
||||
|
||||
#endregion
|
||||
|
||||
#region GetService Tests
|
||||
|
||||
[Fact]
|
||||
public void GetService_RequestingChatMessageStore_ReturnsChatMessageStore()
|
||||
{
|
||||
// Arrange
|
||||
var thread = new TestInMemoryAgentThread();
|
||||
|
||||
// Act & Assert
|
||||
Assert.NotNull(thread.GetService(typeof(ChatMessageStore)));
|
||||
Assert.Same(thread.GetMessageStore(), thread.GetService(typeof(ChatMessageStore)));
|
||||
Assert.Same(thread.GetMessageStore(), thread.GetService(typeof(InMemoryChatMessageStore)));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
// Sealed test subclass to expose protected members for testing
|
||||
private sealed class TestInMemoryAgentThread : InMemoryAgentThread
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user