From 0aa38bed5a667de8c9d0055a35f7efdd8592aba2 Mon Sep 17 00:00:00 2001 From: Maciej Zieniuk Date: Wed, 20 Nov 2024 11:09:59 +0000 Subject: [PATCH] PM-10600: Unit Tests fix to NotificationHubPushRegistrationService after merge conflict --- .../NotificationHubPushRegistrationService.cs | 3 --- .../NotificationHubPushRegistrationServiceTests.cs | 12 ------------ 2 files changed, 15 deletions(-) diff --git a/src/Core/NotificationHub/NotificationHubPushRegistrationService.cs b/src/Core/NotificationHub/NotificationHubPushRegistrationService.cs index 6887022597..f12d7d7fbf 100644 --- a/src/Core/NotificationHub/NotificationHubPushRegistrationService.cs +++ b/src/Core/NotificationHub/NotificationHubPushRegistrationService.cs @@ -11,18 +11,15 @@ public class NotificationHubPushRegistrationService : IPushRegistrationService { private readonly IInstallationDeviceRepository _installationDeviceRepository; private readonly INotificationHubPool _notificationHubPool; - private readonly IServiceProvider _serviceProvider; private readonly IOrganizationUserRepository _organizationUserRepository; public NotificationHubPushRegistrationService( IInstallationDeviceRepository installationDeviceRepository, INotificationHubPool notificationHubPool, - IServiceProvider serviceProvider, IOrganizationUserRepository organizationUserRepository) { _installationDeviceRepository = installationDeviceRepository; _notificationHubPool = notificationHubPool; - _serviceProvider = serviceProvider; _organizationUserRepository = organizationUserRepository; } diff --git a/test/Core.Test/NotificationHub/NotificationHubPushRegistrationServiceTests.cs b/test/Core.Test/NotificationHub/NotificationHubPushRegistrationServiceTests.cs index 7348d56f86..9c63c2c1b9 100644 --- a/test/Core.Test/NotificationHub/NotificationHubPushRegistrationServiceTests.cs +++ b/test/Core.Test/NotificationHub/NotificationHubPushRegistrationServiceTests.cs @@ -3,12 +3,10 @@ using Bit.Core.Enums; using Bit.Core.Models.Data.Organizations.OrganizationUsers; using Bit.Core.NotificationHub; using Bit.Core.Repositories; -using Bit.Core.Services; using Bit.Core.Utilities; using Bit.Test.Common.AutoFixture; using Bit.Test.Common.AutoFixture.Attributes; using Microsoft.Azure.NotificationHubs; -using Microsoft.Extensions.DependencyInjection; using NSubstitute; using Xunit; @@ -38,16 +36,6 @@ public class NotificationHubPushRegistrationServiceTests public async void CreateOrUpdateRegistrationAsync_DeviceTypeAndroid_InstallationCreated(bool identifierNull, SutProvider sutProvider, Guid deviceId, Guid userId, Guid? identifier) { - var featureService = Substitute.For(); - featureService.IsEnabled(FeatureFlagKeys.AnhFcmv1Migration).Returns(true); - var serviceProvider = Substitute.For(); - serviceProvider.GetService(typeof(IFeatureService)).Returns(featureService); - var serviceScope = Substitute.For(); - serviceScope.ServiceProvider.Returns(serviceProvider); - var serviceScopeFactory = Substitute.For(); - serviceScopeFactory.CreateScope().Returns(serviceScope); - sutProvider.GetDependency().GetService(typeof(IServiceScopeFactory)) - .Returns(serviceScopeFactory); var notificationHubClient = Substitute.For(); sutProvider.GetDependency().ClientFor(Arg.Any()).Returns(notificationHubClient);