public void AddFace_WhenCalled_RequestMethodShouldBePost() { _content = new byte[] { }; _helper.Setup(hlpr => hlpr.CreateByteArrayContent("a", "b")) .Returns(new ByteArrayContent(_content)); _api = new PersonAPIs(_helper.Object); var result = _api.AddFace("a", "b", "c"); _messageHandler .Protected() .Verify( "SendAsync", Times.Exactly(TimesCalled), ItExpr.Is <HttpRequestMessage>(req => req.Method == HttpMethod.Post), ItExpr.IsAny <CancellationToken>()); }
public void AddFace_WhenCalled_RequestUriMustBeEqualToExpectedUri() { _uri = new Uri(APISettings.UriBase + "persongroups/a/persons/b/persistedFaces"); _content = new byte[] { }; _helper.Setup(hlpr => hlpr.CreateByteArrayContent("a", "b")) .Returns(new ByteArrayContent(_content)); _api = new PersonAPIs(_helper.Object); var result = _api.AddFace("a", "b", "c"); _messageHandler .Protected() .Verify( "SendAsync", Times.Exactly(TimesCalled), ItExpr.Is <HttpRequestMessage>(req => req.RequestUri == _uri), ItExpr.IsAny <CancellationToken>()); }