diff --git a/src/messaging/dotnet/src/Core/MessageRouterExtensions.cs b/src/messaging/dotnet/src/Core/MessageRouterExtensions.cs index b04687c9c..ca4496493 100644 --- a/src/messaging/dotnet/src/Core/MessageRouterExtensions.cs +++ b/src/messaging/dotnet/src/Core/MessageRouterExtensions.cs @@ -91,7 +91,7 @@ public static ValueTask SubscribeAsync( { Func innerSubscriber = async messageBuffer => { - IMessageContext context = new MessageContext(); + MessageContext context = new MessageContext(); var topicMessage = new TopicMessage(topic, messageBuffer, context); observer.OnNext(topicMessage); diff --git a/src/messaging/dotnet/src/Core/TopicMessage.cs b/src/messaging/dotnet/src/Core/TopicMessage.cs index 357f2d550..c6b394c29 100644 --- a/src/messaging/dotnet/src/Core/TopicMessage.cs +++ b/src/messaging/dotnet/src/Core/TopicMessage.cs @@ -26,7 +26,7 @@ public sealed class TopicMessage /// /// /// - public TopicMessage(string topic, IMessageBuffer? payload, IMessageContext context) + public TopicMessage(string topic, IMessageBuffer? payload, MessageContext context) { Topic = topic; Payload = payload; @@ -47,5 +47,5 @@ public TopicMessage(string topic, IMessageBuffer? payload, IMessageContext conte /// /// Gets contextual information about the message. /// - public IMessageContext Context { get; } + public MessageContext Context { get; } } diff --git a/src/messaging/dotnet/test/Core.Tests/MessageBuffer.Tests.cs b/src/messaging/dotnet/test/Core.Tests/MessageBuffer.Tests.cs index db6736201..c8a1d110a 100644 --- a/src/messaging/dotnet/test/Core.Tests/MessageBuffer.Tests.cs +++ b/src/messaging/dotnet/test/Core.Tests/MessageBuffer.Tests.cs @@ -12,6 +12,7 @@ using System.Buffers; using System.Text; +using System.Text.Json; using MorganStanley.ComposeUI.Messaging.TestUtils; namespace MorganStanley.ComposeUI.Messaging; @@ -228,7 +229,7 @@ public void CreateJson_creates_a_MessageBuffer_with_the_JSON_string() Value = "test-value" }; - var buffer = MessageBuffer.Factory.CreateJson(payload); + var buffer = MessageBuffer.CreateJson(payload); JsonSerializer.Deserialize(buffer.GetString()).Should().BeEquivalentTo(payload); } diff --git a/src/messaging/dotnet/test/IntegrationTests/EndToEndTestsBase.cs b/src/messaging/dotnet/test/IntegrationTests/EndToEndTestsBase.cs index 7e02d501d..29e0719c9 100644 --- a/src/messaging/dotnet/test/IntegrationTests/EndToEndTestsBase.cs +++ b/src/messaging/dotnet/test/IntegrationTests/EndToEndTestsBase.cs @@ -14,6 +14,7 @@ using System.Text.Json; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; +using MorganStanley.ComposeUI.Messaging.Abstractions; using Nito.AsyncEx; namespace MorganStanley.ComposeUI.Messaging; @@ -72,8 +73,8 @@ public async Task Client_can_invoke_a_registered_service() var handlerMock = new Mock(); handlerMock - .Setup(_ => _.Invoke("test-service", It.IsAny(), It.IsAny())) - .Returns(new ValueTask(MessageBuffer.Create("test-response"))); + .Setup(_ => _.Invoke("test-service", It.IsAny(), It.IsAny())) + .Returns(new ValueTask(MessageBuffer.Create("test-response"))); await service.RegisterServiceAsync(endpoint: "test-service", handlerMock.Object);