コード例 #1
0
        public async Task WhenFetchDataThenShouldGetAsync()
        {
            await _objectToTest.FetchData(_currencyPair, (sender, data) =>
            {
                Assert.IsNotNull(data);
            });

            _handlerMock.Protected().Verify(
                "SendAsync",
                Times.Once(),
                ItExpr.Is <HttpRequestMessage>(req =>
                                               req.Method == HttpMethod.Get &&
                                               req.RequestUri == new Uri(_httpClient.BaseAddress + _currencyPair)
                                               ),
                ItExpr.IsAny <CancellationToken>()
                );
        }