public async Task ShouldGetPushNotificationsAsync_All() { // Arrange var loggerMock = new Mock <ILogger>(); var httpClientMock = new HttpClientMock(); httpClientMock.SetupSendAsync() .ReturnsAsync(NotificationOverviewResults.Success("notification_id_test", count: 3)) .Verifiable(); var appCenterConfiguration = new TestAppCenterConfiguration(); var pushNotificationService = new AppCenterPushNotificationService(loggerMock.Object, httpClientMock.Object, appCenterConfiguration); // Act var notificationOverviewResults = await pushNotificationService.GetPushNotificationsAsync(top : 30); // Assert this.testOutputHelper.WriteLine($"{ObjectDumper.Dump(notificationOverviewResults, DumpStyle.CSharp)}"); notificationOverviewResults.Should().BeEquivalentTo(NotificationOverviewResults.GetExample1().Values); httpClientMock.VerifySendAsync( request => request.Method == HttpMethod.Get && request.RequestUri == new Uri("https://appcenter.ms/api/v0.1/apps/testOrg/TestApp.Android/push/notifications?%24top=30&%24orderby=count%20desc&%24inlinecount=none"), Times.Exactly(1) ); httpClientMock.VerifySendAsync( request => request.Method == HttpMethod.Get && request.RequestUri == new Uri("https://appcenter.ms/api/v0.1/apps/testOrg/TestApp.iOS/push/notifications?%24top=30&%24orderby=count%20desc&%24inlinecount=none"), Times.Exactly(1) ); }
public void ShouldDeserializeNotificationOverviewResultInternal() { // Arrange var json = NotificationOverviewResults.GetExample1_Json(); // Act var notificationOverviewResultInternal = JsonConvert.DeserializeObject <NotificationOverviewResultInternal>(json); // Assert notificationOverviewResultInternal.Should().NotBeNull(); notificationOverviewResultInternal.Values.Should().HaveCount(30); }