mirror of
https://github.com/bitwarden/server.git
synced 2025-07-01 16:12:49 -05:00
PM-10564: Sync notification push type separation for notification updates
Sync notification push type is now used for both Notification create and update. Renamed the event types to specifically mention the purpose of status for notification status updates.
This commit is contained in:
@ -66,7 +66,10 @@ public class MarkNotificationDeletedCommandTest
|
||||
await Assert.ThrowsAsync<NotFoundException>(() => sutProvider.Sut.MarkDeletedAsync(notificationId));
|
||||
await sutProvider.GetDependency<IPushNotificationService>()
|
||||
.Received(0)
|
||||
.PushSyncNotificationUpdateAsync(Arg.Any<Notification>(), Arg.Any<NotificationStatus?>());
|
||||
.PushSyncNotificationStatusAsync(Arg.Any<Notification>(), Arg.Any<NotificationStatus>());
|
||||
await sutProvider.GetDependency<IPushNotificationService>()
|
||||
.Received(0)
|
||||
.PushSyncNotificationAsync(Arg.Any<Notification>());
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@ -80,7 +83,10 @@ public class MarkNotificationDeletedCommandTest
|
||||
await Assert.ThrowsAsync<NotFoundException>(() => sutProvider.Sut.MarkDeletedAsync(notificationId));
|
||||
await sutProvider.GetDependency<IPushNotificationService>()
|
||||
.Received(0)
|
||||
.PushSyncNotificationUpdateAsync(Arg.Any<Notification>(), Arg.Any<NotificationStatus?>());
|
||||
.PushSyncNotificationStatusAsync(Arg.Any<Notification>(), Arg.Any<NotificationStatus>());
|
||||
await sutProvider.GetDependency<IPushNotificationService>()
|
||||
.Received(0)
|
||||
.PushSyncNotificationAsync(Arg.Any<Notification>());
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@ -95,7 +101,10 @@ public class MarkNotificationDeletedCommandTest
|
||||
await Assert.ThrowsAsync<NotFoundException>(() => sutProvider.Sut.MarkDeletedAsync(notificationId));
|
||||
await sutProvider.GetDependency<IPushNotificationService>()
|
||||
.Received(0)
|
||||
.PushSyncNotificationUpdateAsync(Arg.Any<Notification>(), Arg.Any<NotificationStatus?>());
|
||||
.PushSyncNotificationStatusAsync(Arg.Any<Notification>(), Arg.Any<NotificationStatus>());
|
||||
await sutProvider.GetDependency<IPushNotificationService>()
|
||||
.Received(0)
|
||||
.PushSyncNotificationAsync(Arg.Any<Notification>());
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@ -110,7 +119,10 @@ public class MarkNotificationDeletedCommandTest
|
||||
await Assert.ThrowsAsync<NotFoundException>(() => sutProvider.Sut.MarkDeletedAsync(notificationId));
|
||||
await sutProvider.GetDependency<IPushNotificationService>()
|
||||
.Received(0)
|
||||
.PushSyncNotificationUpdateAsync(Arg.Any<Notification>(), Arg.Any<NotificationStatus?>());
|
||||
.PushSyncNotificationStatusAsync(Arg.Any<Notification>(), Arg.Any<NotificationStatus>());
|
||||
await sutProvider.GetDependency<IPushNotificationService>()
|
||||
.Received(0)
|
||||
.PushSyncNotificationAsync(Arg.Any<Notification>());
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@ -125,7 +137,10 @@ public class MarkNotificationDeletedCommandTest
|
||||
await Assert.ThrowsAsync<NotFoundException>(() => sutProvider.Sut.MarkDeletedAsync(notificationId));
|
||||
await sutProvider.GetDependency<IPushNotificationService>()
|
||||
.Received(0)
|
||||
.PushSyncNotificationUpdateAsync(Arg.Any<Notification>(), Arg.Any<NotificationStatus?>());
|
||||
.PushSyncNotificationStatusAsync(Arg.Any<Notification>(), Arg.Any<NotificationStatus>());
|
||||
await sutProvider.GetDependency<IPushNotificationService>()
|
||||
.Received(0)
|
||||
.PushSyncNotificationAsync(Arg.Any<Notification>());
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@ -149,8 +164,11 @@ public class MarkNotificationDeletedCommandTest
|
||||
.CreateAsync(Arg.Do<NotificationStatus>(ns => AssertNotificationStatus(expectedNotificationStatus, ns)));
|
||||
await sutProvider.GetDependency<IPushNotificationService>()
|
||||
.Received(1)
|
||||
.PushSyncNotificationUpdateAsync(notification,
|
||||
.PushSyncNotificationStatusAsync(notification,
|
||||
Arg.Do<NotificationStatus>(ns => AssertNotificationStatus(expectedNotificationStatus, ns)));
|
||||
await sutProvider.GetDependency<IPushNotificationService>()
|
||||
.Received(0)
|
||||
.PushSyncNotificationAsync(Arg.Any<Notification>());
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@ -167,8 +185,11 @@ public class MarkNotificationDeletedCommandTest
|
||||
.UpdateAsync(Arg.Do<NotificationStatus>(ns => AssertNotificationStatus(notificationStatus, ns)));
|
||||
await sutProvider.GetDependency<IPushNotificationService>()
|
||||
.Received(1)
|
||||
.PushSyncNotificationUpdateAsync(notification,
|
||||
Arg.Do<NotificationStatus?>(ns => AssertNotificationStatus(notificationStatus, ns)));
|
||||
.PushSyncNotificationStatusAsync(notification,
|
||||
Arg.Do<NotificationStatus>(ns => AssertNotificationStatus(notificationStatus, ns)));
|
||||
await sutProvider.GetDependency<IPushNotificationService>()
|
||||
.Received(0)
|
||||
.PushSyncNotificationAsync(Arg.Any<Notification>());
|
||||
}
|
||||
|
||||
private static void AssertNotificationStatus(NotificationStatus expectedNotificationStatus,
|
||||
|
Reference in New Issue
Block a user