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