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:
parent
ccf685f29d
commit
0aa38bed5a
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user