fix(discord): update sessions via interactions
This commit is contained in:
+19
-1
@@ -13,6 +13,7 @@ public sealed class PlatformNeutralSessionInteractionCommandTests
|
||||
AssertProperty<JoinSessionCommand>("InteractionId", typeof(string));
|
||||
AssertProperty<JoinSessionCommand>("Group", typeof(PlatformGroup));
|
||||
AssertProperty<JoinSessionCommand>("ScheduleMessage", typeof(PlatformMessageRef));
|
||||
AssertProperty<JoinSessionCommand>("DeferScheduleUpdate", typeof(bool));
|
||||
AssertNoTelegramSpecificProperties<JoinSessionCommand>();
|
||||
}
|
||||
|
||||
@@ -24,12 +25,29 @@ public sealed class PlatformNeutralSessionInteractionCommandTests
|
||||
AssertProperty<LeaveSessionCommand>("InteractionId", typeof(string));
|
||||
AssertProperty<LeaveSessionCommand>("Group", typeof(PlatformGroup));
|
||||
AssertProperty<LeaveSessionCommand>("ScheduleMessage", typeof(PlatformMessageRef));
|
||||
AssertProperty<LeaveSessionCommand>("DeferScheduleUpdate", typeof(bool));
|
||||
AssertNoTelegramSpecificProperties<LeaveSessionCommand>();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SessionInteractionResult_ShouldExposeReplyTextAndUpdatedView()
|
||||
{
|
||||
var resultType = typeof(JoinSessionCommand).Assembly.GetType(
|
||||
"GmRelay.Shared.Features.Sessions.CreateSession.SessionInteractionResult");
|
||||
|
||||
Assert.NotNull(resultType);
|
||||
AssertProperty(resultType, "ReplyText", typeof(string));
|
||||
AssertProperty(resultType, "UpdatedView", typeof(GmRelay.Shared.Rendering.SessionBatchViewModel));
|
||||
}
|
||||
|
||||
private static void AssertProperty<T>(string name, Type expectedType)
|
||||
{
|
||||
var property = Assert.Single(typeof(T).GetProperties(), property => property.Name == name);
|
||||
AssertProperty(typeof(T), name, expectedType);
|
||||
}
|
||||
|
||||
private static void AssertProperty(Type type, string name, Type expectedType)
|
||||
{
|
||||
var property = Assert.Single(type.GetProperties(), property => property.Name == name);
|
||||
|
||||
Assert.Equal(expectedType, property.PropertyType);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user