1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-24 12:35:25 +01:00

PM-10600: Unit Tests fix to NotificationHubPushRegistrationService after merge conflict

This commit is contained in:
Maciej Zieniuk 2024-11-20 11:09:59 +00:00
parent ccf685f29d
commit 0aa38bed5a
No known key found for this signature in database
GPG Key ID: 9CACE59F1272ACD9
2 changed files with 0 additions and 15 deletions

View File

@ -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;
}

View File

@ -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<NotificationHubPushRegistrationService> sutProvider, Guid deviceId, Guid userId, Guid? identifier)
{
var featureService = Substitute.For<IFeatureService>();
featureService.IsEnabled(FeatureFlagKeys.AnhFcmv1Migration).Returns(true);
var serviceProvider = Substitute.For<IServiceProvider>();
serviceProvider.GetService(typeof(IFeatureService)).Returns(featureService);
var serviceScope = Substitute.For<IServiceScope>();
serviceScope.ServiceProvider.Returns(serviceProvider);
var serviceScopeFactory = Substitute.For<IServiceScopeFactory>();
serviceScopeFactory.CreateScope().Returns(serviceScope);
sutProvider.GetDependency<IServiceProvider>().GetService(typeof(IServiceScopeFactory))
.Returns(serviceScopeFactory);
var notificationHubClient = Substitute.For<INotificationHubClient>();
sutProvider.GetDependency<INotificationHubPool>().ClientFor(Arg.Any<Guid>()).Returns(notificationHubClient);