public async Task WhenITellTheUserNotificationStoreToStoreTheUserNotificationCalledAndCallTheResult(string notificationName, string resultName) { IUserNotificationStore store = this.serviceProvider.GetRequiredService <IUserNotificationStore>(); UserNotification notification = this.scenarioContext.Get <UserNotification>(notificationName); try { UserNotification result = await store.StoreAsync(notification).ConfigureAwait(false); this.scenarioContext.Set(result, resultName); } catch (Exception ex) { ExceptionSteps.StoreLastExceptionInScenarioContext(ex, this.scenarioContext); } }
public async Task WhenIUseTheClientToSendAManagementAPIRequestToCreateANewNotification(Table table) { IJsonSerializerSettingsProvider jsonSerializerSettingsProvider = this.serviceProvider.GetRequiredService <IJsonSerializerSettingsProvider>(); CreateNotificationsRequest data = BuildCreateNotificationsRequestFrom(table.Rows[0], jsonSerializerSettingsProvider.Instance); string transientTenantId = this.featureContext.GetTransientTenantId(); IUserNotificationsManagementClient client = this.serviceProvider.GetRequiredService <IUserNotificationsManagementClient>(); try { ApiResponse result = await client.CreateNotificationsAsync(transientTenantId, data, CancellationToken.None).ConfigureAwait(false); this.StoreApiResponseDetails(result.StatusCode, result.Headers); } catch (Exception ex) { ExceptionSteps.StoreLastExceptionInScenarioContext(ex, this.scenarioContext); } }
public async Task WhenIUseTheClientToSendAnAPIDeliveryRequestWithAnNon_ExistentTenantIdForNotificationsForTheUserWithId(string userId) { string transientTenantId = this.featureContext.GetTransientTenantId(); IUserNotificationsApiDeliveryChannelClient client = this.serviceProvider.GetRequiredService <IUserNotificationsApiDeliveryChannelClient>(); try { ApiResponse <PagedNotificationListResource> result = await client.GetUserNotificationsAsync( "75b9261673c2714681f14c97bc0439fb0000a5fa332426462456245252435600", userId, null, null).ConfigureAwait(false); this.StoreApiResponseDetails(result.StatusCode, result.Headers, result.Body); } catch (Exception ex) { ExceptionSteps.StoreLastExceptionInScenarioContext(ex, this.scenarioContext); } }