public async Task WebhookUnsubscribeFailureTest() { string sourceInfo = "{\"PageId\":\"abc\",\"AccessToken\":\"abc\",\"PageName\":\"abc\"}"; SubscribeWebhookResponseFB response = new SubscribeWebhookResponseFB() { Success = false, }; var restApiRepositoryMock = new Mock <IRestApiRepository>(); restApiRepositoryMock.Setup(x => x.DeleteRequestAsync <SubscribeWebhookResponseFB>(It.IsAny <string>(), It.IsAny <Dictionary <string, string> >(), It.IsAny <CancellationToken>())) .ReturnsAsync(response); var facebookProvider = new FacebookProvider(new AzureTableProvider(Settings.StorageAccountConnectionString)) { Client = restApiRepositoryMock.Object }; var unsubscribed = await facebookProvider.Unsubscribe(sourceInfo); Assert.AreEqual(unsubscribed, false); }