File tree Expand file tree Collapse file tree
src/ModelContextProtocol.Core/Server
tests/ModelContextProtocol.Tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33using System . Diagnostics . CodeAnalysis ;
44using System . Text . Json ;
55
6+ #if MCP_TEST_TIME_PROVIDER
7+ namespace ModelContextProtocol . Tests . Internal ;
8+ #else
69namespace ModelContextProtocol ;
10+ #endif
711
812/// <summary>
913/// Provides an in-memory implementation of <see cref="IMcpTaskStore"/> for development and testing.
Original file line number Diff line number Diff line change 1010 <IsTestProject >true</IsTestProject >
1111 <RootNamespace >ModelContextProtocol.Tests</RootNamespace >
1212 <!-- https://github.com/dotnet/sdk/issues/51060 -->
13- <!-- CS0436: InMemoryMcpTaskStore.cs is linked to enable TimeProvider support for testing.
14- This shadows the type from ModelContextProtocol.Core, causing CS0436 at all usage sites. -->
15- <NoWarn >$(NoWarn);NU1903;NU1902;CS0436</NoWarn >
13+ <NoWarn >$(NoWarn);NU1903;NU1902</NoWarn >
1614 <!-- Define for conditional TimeProvider support in InMemoryMcpTaskStore -->
1715 <DefineConstants >$(DefineConstants);MCP_TEST_TIME_PROVIDER</DefineConstants >
1816 </PropertyGroup >
Original file line number Diff line number Diff line change 33using ModelContextProtocol . Server ;
44using ModelContextProtocol . Tests . Utils ;
55using System . Text . Json ;
6+ using TestInMemoryMcpTaskStore = ModelContextProtocol . Tests . Internal . InMemoryMcpTaskStore ;
67
78namespace ModelContextProtocol . Tests . Server ;
89
@@ -1038,7 +1039,7 @@ public async Task ListTasksAsync_KeysetPaginationWorksWithIdenticalTimestamps()
10381039 {
10391040 // Arrange - Use a fake time provider to create tasks with identical timestamps
10401041 var fakeTime = new FakeTimeProvider ( DateTimeOffset . UtcNow ) ;
1041- using var store = new InMemoryMcpTaskStore (
1042+ using var store = new TestInMemoryMcpTaskStore (
10421043 defaultTtl : null ,
10431044 maxTtl : null ,
10441045 pollInterval : null ,
You can’t perform that action at this time.
0 commit comments