feat(notification-outbox): per-site KPI request/response message contracts

This commit is contained in:
Joseph Doherty
2026-05-19 05:33:37 -04:00
parent d54c3da291
commit adcab9dcfc
2 changed files with 42 additions and 0 deletions

View File

@@ -1,4 +1,5 @@
using ScadaLink.Commons.Messages.Notification;
using ScadaLink.Commons.Types.Notifications;
namespace ScadaLink.Commons.Tests.Messages;
@@ -187,4 +188,26 @@ public class NotificationMessagesTests
var msg = new NotificationKpiRequest("corr-1");
Assert.Equal("corr-1", msg.CorrelationId);
}
[Fact]
public void PerSiteNotificationKpiRequest_CarriesCorrelationId()
{
var request = new PerSiteNotificationKpiRequest("corr-1");
Assert.Equal("corr-1", request.CorrelationId);
}
[Fact]
public void PerSiteNotificationKpiResponse_CarriesPerSiteSnapshots()
{
var sites = new[]
{
new SiteNotificationKpiSnapshot("plant-a", 3, 1, 0, 10, TimeSpan.FromMinutes(4)),
};
var response = new PerSiteNotificationKpiResponse("corr-1", Success: true, ErrorMessage: null, sites);
Assert.True(response.Success);
Assert.Null(response.ErrorMessage);
Assert.Single(response.Sites);
Assert.Equal("plant-a", response.Sites[0].SourceSiteId);
}
}