feat(platform): route scheduler notifications through platform messenger
PR Checks / test-and-build (pull_request) Successful in 7m9s
PR Checks / test-and-build (pull_request) Successful in 7m9s
This commit is contained in:
@@ -51,4 +51,42 @@ public sealed class PlatformContractsTests
|
||||
Assert.Equal(PlatformKind.Discord, message.Group.Platform);
|
||||
Assert.Same(view, message.View);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PlatformNotificationContracts_ShouldBeSdkAssemblyFree()
|
||||
{
|
||||
var contractTypes = new[]
|
||||
{
|
||||
typeof(PlatformSessionParticipant),
|
||||
typeof(PlatformConfirmationRequest),
|
||||
typeof(PlatformJoinLinkNotification),
|
||||
typeof(PlatformDirectSessionNotification),
|
||||
typeof(PlatformRsvpMessageUpdate),
|
||||
typeof(PlatformRsvpOutcomeNotification),
|
||||
typeof(PlatformRescheduleVoteUpdate)
|
||||
};
|
||||
|
||||
Assert.All(contractTypes, type =>
|
||||
{
|
||||
var refs = string.Join(" ", type.Assembly.GetReferencedAssemblies().Select(value => value.Name));
|
||||
Assert.DoesNotContain("Telegram", refs, StringComparison.OrdinalIgnoreCase);
|
||||
Assert.DoesNotContain("NetCord", refs, StringComparison.OrdinalIgnoreCase);
|
||||
});
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PlatformMessenger_ShouldExposeSchedulerNotificationOperations()
|
||||
{
|
||||
var methods = typeof(IPlatformMessenger)
|
||||
.GetMethods()
|
||||
.Select(method => method.Name)
|
||||
.ToHashSet(StringComparer.Ordinal);
|
||||
|
||||
Assert.Contains("SendConfirmationRequestAsync", methods);
|
||||
Assert.Contains("UpdateConfirmationRequestAsync", methods);
|
||||
Assert.Contains("SendJoinLinkNotificationAsync", methods);
|
||||
Assert.Contains("SendDirectSessionNotificationAsync", methods);
|
||||
Assert.Contains("SendRsvpOutcomeAsync", methods);
|
||||
Assert.Contains("UpdateRescheduleVoteAsync", methods);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user