public ApiResourceAppServiceInMemoryTest(WarmupInMemory inMemoryData, ITestOutputHelper output)
 {
     _output                = output;
     InMemoryData           = inMemoryData;
     _apiResourceAppService = InMemoryData.Services.GetRequiredService <IApiResourceAppService>();
     _database              = InMemoryData.Services.GetRequiredService <JPProjectAdminUIContext>();
     _notifications         = (DomainNotificationHandler)InMemoryData.Services.GetRequiredService <INotificationHandler <DomainNotification> >();
     _notifications.Clear();
 }
Beispiel #2
0
 public IdentityResourceAppServiceTests(WarmupInMemory inMemoryData, ITestOutputHelper output)
 {
     _output           = output;
     InMemoryData      = inMemoryData;
     _identityResource = InMemoryData.Services.GetRequiredService <IIdentityResourceAppService>();
     _database         = InMemoryData.Services.GetRequiredService <JpProjectAdminUiContext>();
     _notifications    = (DomainNotificationHandler)InMemoryData.Services.GetRequiredService <INotificationHandler <DomainNotification> >();
     _notifications.Clear();
 }
Beispiel #3
0
 public ClientAppServiceInMemoryTest(WarmupInMemory inMemoryData, ITestOutputHelper output)
 {
     _faker            = new Faker();
     _output           = output;
     InMemoryData      = inMemoryData;
     _clientAppService = InMemoryData.Services.GetRequiredService <IClientAppService>();
     _database         = InMemoryData.Services.GetRequiredService <JpProjectAdminUiContext>();
     _notifications    = (DomainNotificationHandler)InMemoryData.Services.GetRequiredService <INotificationHandler <DomainNotification> >();
     _notifications.Clear();
 }
        public EmailAppServiceInMemoryTests(WarmupUnifiedContext unifiedContext, ITestOutputHelper output)
        {
            _output            = output;
            _faker             = new Faker();
            UnifiedContextData = unifiedContext;
            _emailAppService   = UnifiedContextData.Services.GetRequiredService <IEmailAppService>();
            _database          = UnifiedContextData.Services.GetRequiredService <UnifiedContext>();
            _notifications     = (DomainNotificationHandler)UnifiedContextData.Services.GetRequiredService <INotificationHandler <DomainNotification> >();

            _notifications.Clear();
        }
Beispiel #5
0
        public EmailAppServiceInMemoryTests(WarmupInMemory inMemory, ITestOutputHelper output)
        {
            _output          = output;
            _faker           = new Faker();
            InMemoryData     = inMemory;
            _emailAppService = InMemoryData.Services.GetRequiredService <IEmailAppService>();
            _database        = InMemoryData.Services.GetRequiredService <ApplicationSsoContext>();
            _notifications   = (DomainNotificationHandler)InMemoryData.Services.GetRequiredService <INotificationHandler <DomainNotification> >();

            _notifications.Clear();
        }
Beispiel #6
0
        protected UserAppServiceAbstractTests(TWarmup unifiedContext, ITestOutputHelper output)
        {
            _output                = output;
            _faker                 = new Faker();
            UnifiedContextData     = unifiedContext;
            _userAppService        = UnifiedContextData.Services.GetRequiredService <IUserAppService>();
            _userManagerAppService = UnifiedContextData.Services.GetRequiredService <IUserManageAppService>();

            _notifications = (DomainNotificationHandler)UnifiedContextData.Services.GetRequiredService <INotificationHandler <DomainNotification> >();

            _notifications.Clear();
        }
        public EventAppServiceTest(WarmupUnifiedContext unifiedContext, ITestOutputHelper output)
        {
            _output               = output;
            _faker                = new Faker();
            UnifiedContextData    = unifiedContext;
            _eventStoreAppService = UnifiedContextData.Services.GetRequiredService <IEventStoreAppService>();
            _userAppService       = UnifiedContextData.Services.GetRequiredService <IUserAppService>();
            _database             = UnifiedContextData.Services.GetRequiredService <UnifiedContext>();
            _notifications        = (DomainNotificationHandler)UnifiedContextData.Services.GetRequiredService <INotificationHandler <DomainNotification> >();

            _notifications.Clear();
        }
        public GlobalSettingsTests(WarmupUnifiedContext unifiedContext, ITestOutputHelper output)
        {
            _output            = output;
            _faker             = new Faker();
            UnifiedContextData = unifiedContext;
            _globalAppService  = UnifiedContextData.Services.GetRequiredService <IGlobalConfigurationAppService>();
            _database          = UnifiedContextData.Services.GetRequiredService <ISsoContext>();

            _user           = (AspNetUserTest)UnifiedContextData.Services.GetService <ISystemUser>();
            _user._isInRole = true;
            _notifications  = (DomainNotificationHandler)UnifiedContextData.Services.GetRequiredService <INotificationHandler <DomainNotification> >();

            _notifications.Clear();
        }
        public async void DomainNotificationClear_Ok()
        {
            var faker = new Faker();


            var handler = new DomainNotificationHandler();


            var qtError   = faker.Random.Int(min: 3, max: 10);
            var qtSuccess = faker.Random.Int(min: 3, max: 10);


            for (var i = 0; i < qtError; i++)
            {
                var message = faker.Lorem.Sentence();

                var domainNotification = DomainNotification.Fail(message);
                await handler.Handle(domainNotification, new CancellationToken());
            }

            for (var i = 0; i < qtSuccess; i++)
            {
                var message = faker.Lorem.Sentence();

                var domainNotification = DomainNotification.Success(message);
                await handler.Handle(domainNotification, new CancellationToken());
            }

            handler.Clear();

            var notificationsError   = handler.GetNotificationsError();
            var notificationsSuccess = handler.GetNotificationsSuccess();

            Assert.False(handler.HasNotificationsError());
            Assert.False(handler.HasNotificationsSucess());


            Assert.True(notificationsError.Count == 0);
            Assert.True(notificationsSuccess.Count == 0);
        }
 public void ClearNotifications()
 {
     _notificationHandler.Clear();
 }
Beispiel #11
0
 public void ClearNotifications() => _domainNotification.Clear();