diff --git a/src/Core/NotificationCenter/Commands/MarkNotificationDeletedCommand.cs b/src/Core/NotificationCenter/Commands/MarkNotificationDeletedCommand.cs index 2928f4ccb2..67d3f8dd4f 100644 --- a/src/Core/NotificationCenter/Commands/MarkNotificationDeletedCommand.cs +++ b/src/Core/NotificationCenter/Commands/MarkNotificationDeletedCommand.cs @@ -65,7 +65,7 @@ public class MarkNotificationDeletedCommand : IMarkNotificationDeletedCommand var newNotificationStatus = await _notificationStatusRepository.CreateAsync(notificationStatus); - await _pushNotificationService.PushSyncNotificationCreateAsync(notification, newNotificationStatus); + await _pushNotificationService.PushSyncNotificationUpdateAsync(notification, newNotificationStatus); } else { @@ -76,7 +76,7 @@ public class MarkNotificationDeletedCommand : IMarkNotificationDeletedCommand await _notificationStatusRepository.UpdateAsync(notificationStatus); - await _pushNotificationService.PushSyncNotificationCreateAsync(notification, notificationStatus); + await _pushNotificationService.PushSyncNotificationUpdateAsync(notification, notificationStatus); } } } diff --git a/src/Core/NotificationCenter/Commands/MarkNotificationReadCommand.cs b/src/Core/NotificationCenter/Commands/MarkNotificationReadCommand.cs index a0bfd271f2..17dc3a2f0a 100644 --- a/src/Core/NotificationCenter/Commands/MarkNotificationReadCommand.cs +++ b/src/Core/NotificationCenter/Commands/MarkNotificationReadCommand.cs @@ -65,7 +65,7 @@ public class MarkNotificationReadCommand : IMarkNotificationReadCommand var newNotificationStatus = await _notificationStatusRepository.CreateAsync(notificationStatus); - await _pushNotificationService.PushSyncNotificationCreateAsync(notification, newNotificationStatus); + await _pushNotificationService.PushSyncNotificationUpdateAsync(notification, newNotificationStatus); } else { @@ -76,7 +76,7 @@ public class MarkNotificationReadCommand : IMarkNotificationReadCommand await _notificationStatusRepository.UpdateAsync(notificationStatus); - await _pushNotificationService.PushSyncNotificationCreateAsync(notification, notificationStatus); + await _pushNotificationService.PushSyncNotificationUpdateAsync(notification, notificationStatus); } } } diff --git a/src/Core/NotificationCenter/Commands/UpdateNotificationCommand.cs b/src/Core/NotificationCenter/Commands/UpdateNotificationCommand.cs index 77af283353..ad2b2bc4a0 100644 --- a/src/Core/NotificationCenter/Commands/UpdateNotificationCommand.cs +++ b/src/Core/NotificationCenter/Commands/UpdateNotificationCommand.cs @@ -48,6 +48,6 @@ public class UpdateNotificationCommand : IUpdateNotificationCommand await _notificationRepository.ReplaceAsync(notification); - await _pushNotificationService.PushSyncNotificationCreateAsync(notification, null); + await _pushNotificationService.PushSyncNotificationUpdateAsync(notification, null); } } diff --git a/test/Core.Test/NotificationCenter/Commands/MarkNotificationDeletedCommandTest.cs b/test/Core.Test/NotificationCenter/Commands/MarkNotificationDeletedCommandTest.cs index adcdfa44bf..15a2807e55 100644 --- a/test/Core.Test/NotificationCenter/Commands/MarkNotificationDeletedCommandTest.cs +++ b/test/Core.Test/NotificationCenter/Commands/MarkNotificationDeletedCommandTest.cs @@ -66,7 +66,7 @@ public class MarkNotificationDeletedCommandTest await Assert.ThrowsAsync(() => sutProvider.Sut.MarkDeletedAsync(notificationId)); await sutProvider.GetDependency() .Received(0) - .PushSyncNotificationCreateAsync(Arg.Any(), Arg.Any()); + .PushSyncNotificationUpdateAsync(Arg.Any(), Arg.Any()); } [Theory] @@ -80,7 +80,7 @@ public class MarkNotificationDeletedCommandTest await Assert.ThrowsAsync(() => sutProvider.Sut.MarkDeletedAsync(notificationId)); await sutProvider.GetDependency() .Received(0) - .PushSyncNotificationCreateAsync(Arg.Any(), Arg.Any()); + .PushSyncNotificationUpdateAsync(Arg.Any(), Arg.Any()); } [Theory] @@ -95,7 +95,7 @@ public class MarkNotificationDeletedCommandTest await Assert.ThrowsAsync(() => sutProvider.Sut.MarkDeletedAsync(notificationId)); await sutProvider.GetDependency() .Received(0) - .PushSyncNotificationCreateAsync(Arg.Any(), Arg.Any()); + .PushSyncNotificationUpdateAsync(Arg.Any(), Arg.Any()); } [Theory] @@ -110,7 +110,7 @@ public class MarkNotificationDeletedCommandTest await Assert.ThrowsAsync(() => sutProvider.Sut.MarkDeletedAsync(notificationId)); await sutProvider.GetDependency() .Received(0) - .PushSyncNotificationCreateAsync(Arg.Any(), Arg.Any()); + .PushSyncNotificationUpdateAsync(Arg.Any(), Arg.Any()); } [Theory] @@ -125,7 +125,7 @@ public class MarkNotificationDeletedCommandTest await Assert.ThrowsAsync(() => sutProvider.Sut.MarkDeletedAsync(notificationId)); await sutProvider.GetDependency() .Received(0) - .PushSyncNotificationCreateAsync(Arg.Any(), Arg.Any()); + .PushSyncNotificationUpdateAsync(Arg.Any(), Arg.Any()); } [Theory] @@ -149,7 +149,7 @@ public class MarkNotificationDeletedCommandTest .CreateAsync(Arg.Do(ns => AssertNotificationStatus(expectedNotificationStatus, ns))); await sutProvider.GetDependency() .Received(1) - .PushSyncNotificationCreateAsync(notification, + .PushSyncNotificationUpdateAsync(notification, Arg.Do(ns => AssertNotificationStatus(expectedNotificationStatus, ns))); } @@ -167,7 +167,7 @@ public class MarkNotificationDeletedCommandTest .UpdateAsync(Arg.Do(ns => AssertNotificationStatus(notificationStatus, ns))); await sutProvider.GetDependency() .Received(1) - .PushSyncNotificationCreateAsync(notification, + .PushSyncNotificationUpdateAsync(notification, Arg.Do(ns => AssertNotificationStatus(notificationStatus, ns))); } diff --git a/test/Core.Test/NotificationCenter/Commands/MarkNotificationReadCommandTest.cs b/test/Core.Test/NotificationCenter/Commands/MarkNotificationReadCommandTest.cs index cb607fe159..f6b0c58803 100644 --- a/test/Core.Test/NotificationCenter/Commands/MarkNotificationReadCommandTest.cs +++ b/test/Core.Test/NotificationCenter/Commands/MarkNotificationReadCommandTest.cs @@ -66,7 +66,7 @@ public class MarkNotificationReadCommandTest await Assert.ThrowsAsync(() => sutProvider.Sut.MarkReadAsync(notificationId)); await sutProvider.GetDependency() .Received(0) - .PushSyncNotificationCreateAsync(Arg.Any(), Arg.Any()); + .PushSyncNotificationUpdateAsync(Arg.Any(), Arg.Any()); } [Theory] @@ -80,7 +80,7 @@ public class MarkNotificationReadCommandTest await Assert.ThrowsAsync(() => sutProvider.Sut.MarkReadAsync(notificationId)); await sutProvider.GetDependency() .Received(0) - .PushSyncNotificationCreateAsync(Arg.Any(), Arg.Any()); + .PushSyncNotificationUpdateAsync(Arg.Any(), Arg.Any()); } [Theory] @@ -95,7 +95,7 @@ public class MarkNotificationReadCommandTest await Assert.ThrowsAsync(() => sutProvider.Sut.MarkReadAsync(notificationId)); await sutProvider.GetDependency() .Received(0) - .PushSyncNotificationCreateAsync(Arg.Any(), Arg.Any()); + .PushSyncNotificationUpdateAsync(Arg.Any(), Arg.Any()); } [Theory] @@ -110,7 +110,7 @@ public class MarkNotificationReadCommandTest await Assert.ThrowsAsync(() => sutProvider.Sut.MarkReadAsync(notificationId)); await sutProvider.GetDependency() .Received(0) - .PushSyncNotificationCreateAsync(Arg.Any(), Arg.Any()); + .PushSyncNotificationUpdateAsync(Arg.Any(), Arg.Any()); } [Theory] @@ -125,7 +125,7 @@ public class MarkNotificationReadCommandTest await Assert.ThrowsAsync(() => sutProvider.Sut.MarkReadAsync(notificationId)); await sutProvider.GetDependency() .Received(0) - .PushSyncNotificationCreateAsync(Arg.Any(), Arg.Any()); + .PushSyncNotificationUpdateAsync(Arg.Any(), Arg.Any()); } [Theory] @@ -149,7 +149,7 @@ public class MarkNotificationReadCommandTest .CreateAsync(Arg.Do(ns => AssertNotificationStatus(expectedNotificationStatus, ns))); await sutProvider.GetDependency() .Received(1) - .PushSyncNotificationCreateAsync(notification, + .PushSyncNotificationUpdateAsync(notification, Arg.Do(ns => AssertNotificationStatus(expectedNotificationStatus, ns))); } @@ -167,7 +167,7 @@ public class MarkNotificationReadCommandTest .UpdateAsync(Arg.Do(ns => AssertNotificationStatus(notificationStatus, ns))); await sutProvider.GetDependency() .Received(1) - .PushSyncNotificationCreateAsync(notification, + .PushSyncNotificationUpdateAsync(notification, Arg.Do(ns => AssertNotificationStatus(notificationStatus, ns))); } diff --git a/test/Core.Test/NotificationCenter/Commands/UpdateNotificationCommandTest.cs b/test/Core.Test/NotificationCenter/Commands/UpdateNotificationCommandTest.cs index 2cd8e2a40e..d45233b6d1 100644 --- a/test/Core.Test/NotificationCenter/Commands/UpdateNotificationCommandTest.cs +++ b/test/Core.Test/NotificationCenter/Commands/UpdateNotificationCommandTest.cs @@ -48,7 +48,7 @@ public class UpdateNotificationCommandTest await Assert.ThrowsAsync(() => sutProvider.Sut.UpdateAsync(notification)); await sutProvider.GetDependency() .Received(0) - .PushSyncNotificationCreateAsync(Arg.Any(), Arg.Any()); + .PushSyncNotificationUpdateAsync(Arg.Any(), Arg.Any()); } [Theory] @@ -62,7 +62,7 @@ public class UpdateNotificationCommandTest await Assert.ThrowsAsync(() => sutProvider.Sut.UpdateAsync(notification)); await sutProvider.GetDependency() .Received(0) - .PushSyncNotificationCreateAsync(Arg.Any(), Arg.Any()); + .PushSyncNotificationUpdateAsync(Arg.Any(), Arg.Any()); } [Theory] @@ -100,6 +100,6 @@ public class UpdateNotificationCommandTest DateTime.UtcNow - n.RevisionDate < TimeSpan.FromMinutes(1))); await sutProvider.GetDependency() .Received(1) - .PushSyncNotificationCreateAsync(notification, null); + .PushSyncNotificationUpdateAsync(notification, null); } }