GetNotificationsAsync() public method

Get a list of all notifications from the authorized account
public GetNotificationsAsync ( bool onlyShowNew = true ) : Task>
onlyShowNew bool Only retrieve new notifications (un-viewed)
return Task>
コード例 #1
0
		public async Task TestGetAccountNotifications()
		{
			var imgurClient = await AuthenticationHelpers.CreateOAuth2AuthenticatedImgurClient();
			var notificationEndpoints = new NotifcationEndpoint(imgurClient);

			var notifications = await notificationEndpoints.GetNotificationsAsync(false);

			// Assert the Reponse
			Assert.IsNotNull(notifications);
			Assert.AreEqual(notifications.Success, true);
			Assert.AreEqual(notifications.Status, HttpStatusCode.OK);
		}
コード例 #2
0
		public async Task TestGetAccountNotification()
		{
			var imgurClient = await AuthenticationHelpers.CreateOAuth2AuthenticatedImgurClient();
			var notificationEndpoints = new NotifcationEndpoint(imgurClient);

			var notifications = await notificationEndpoints.GetNotificationsAsync();
			if (!notifications.Data.Replies.Any()) return;
			var commentNotification = await notificationEndpoints.GetNotificationAsync(notifications.Data.Replies[0].Id);

			// Assert the Comment Replies Response
			Assert.IsNotNull(commentNotification);
			Assert.AreEqual(commentNotification.Success, true);
			Assert.AreEqual(commentNotification.Status, HttpStatusCode.OK);
		}