public DataflowWebHookSenderTests()
 {
     _handlerMock = new HttpMessageHandlerMock();
     _httpClient = new HttpClient(_handlerMock);
     _options = new ExecutionDataflowBlockOptions();
     _loggerMock = new Mock<ILogger>();
 }
 public AzureWebHookDequeueManagerTests()
 {
     _logger = new Mock<ILogger>().Object;
     _storageMock = StorageManagerMock.Create();
     _senderMock = new Mock<WebHookSender>(_logger);
     _handlerMock = new HttpMessageHandlerMock();
 }
 public TrelloWebHookClientTests()
 {
     _receiver = new Uri("http://localhost/");
     _handlerMock = new HttpMessageHandlerMock();
     _httpClient = new HttpClient(_handlerMock);
     _trelloClient = new TrelloWebHookClient(TestToken, TestAppKey, _httpClient);
 }
        public StripeWebHookReceiverTests()
        {
            _settings = new SettingsDictionary();
            _settings["MS_WebHookReceiverSecret_Stripe"] = TestSecret;

            _config = HttpConfigurationMock.Create(new Dictionary<Type, object> { { typeof(SettingsDictionary), _settings } });
            _context = new HttpRequestContext { Configuration = _config };

            _stripeResponse = new HttpResponseMessage();
            _stripeResponse.Content = new StringContent("{ \"type\": \"action\" }", Encoding.UTF8, "application/json");

            _handlerMock = new HttpMessageHandlerMock();
            _handlerMock.Handler = (req, counter) =>
            {
                string expected = string.Format(CultureInfo.InvariantCulture, StripeWebHookReceiver.EventUriTemplate, TestId);
                Assert.Equal(req.RequestUri.AbsoluteUri, expected);
                return Task.FromResult(_stripeResponse);
            };

            _httpClient = new HttpClient(_handlerMock);
            _receiverMock = new Mock<StripeWebHookReceiver>(_httpClient) { CallBase = true };

            _postRequest = new HttpRequestMessage { Method = HttpMethod.Post };
            _postRequest.SetRequestContext(_context);
        }
 public InstagramWebHookClientTests()
 {
     _httpConfig = new HttpConfiguration();
     _handlerMock = new HttpMessageHandlerMock();
     _httpClient = new HttpClient(_handlerMock);
     _clientMock = new Mock<InstagramWebHookClient>(_httpConfig, _httpClient) { CallBase = true };
     _client = _clientMock.Object;
     _callback = new Uri(TestCallback);
 }
Esempio n. 6
0
 public WebHookManagerTests()
 {
     _handlerMock = new HttpMessageHandlerMock();
     _httpClient = new HttpClient(_handlerMock);
     _storeMock = new Mock<IWebHookStore>();
     _storeMock.Setup<Task<ICollection<WebHook>>>(s => s.QueryWebHooksAsync(TestUser, new[] { "a1" }))
         .ReturnsAsync(new Collection<WebHook> { CreateWebHook() })
         .Verifiable();
     _senderMock = new Mock<IWebHookSender>();
     _loggerMock = new Mock<ILogger>();
     _response = new HttpResponseMessage();
 }