public void Train_WhenCalled_ReturnHttpStatusCodeOfAccepted() { var result = _api.Train(ParameterConstants.PersonGroupId) .Result; Assert.That(result.StatusCode, Is.EqualTo(HttpStatusCode.Accepted)); }
public void Train_WhenCalled_RequestMethodShouldBePost() { _api = new PersonGroupAPIs(_helper.Object); var result = _api.Train("a"); _messageHandler .Protected() .Verify( "SendAsync", Times.Exactly(TimesCalled), ItExpr.Is <HttpRequestMessage>(req => req.Method == HttpMethod.Post), ItExpr.IsAny <CancellationToken>()); }
public void Train_WhenCalled_RequestUriMustBeEqualToExpectedUri() { _uri = new Uri(APISettings.UriBase + "persongroups/a/train"); _api = new PersonGroupAPIs(_helper.Object); var result = _api.Train("a"); _messageHandler .Protected() .Verify( "SendAsync", Times.Exactly(TimesCalled), ItExpr.Is <HttpRequestMessage>(req => req.RequestUri == _uri), ItExpr.IsAny <CancellationToken>()); }