Ejemplo n.º 1
0
        public async Task Login_sends_a_request_with_the_specified_credentials()
        {
            _requestSender
            .SendAsync(Arg.Any <HttpRequestMessageTemplate>())
            .Returns(ci => Response.GetToken(ci.Arg <HttpRequestMessageTemplate>()));

            await _sut.FetchAccessTokenAsync();

            await _requestSender
            .Received(1)
            .SendAsync(Arg.Is <HttpRequestMessageTemplate>(m =>
                                                           m.Method == HttpMethod.Post &&
                                                           IsFormWithClientCredentials(m.Content, ExpectedClientId, ExpectedClientSecret)));
        }