public void IdentifyFace_WhenCalled_ReturnAString(HttpStatusCode httpStatusCode) { _faceAPI.Setup(api => api.Identify(new List <string> { "a" }, "a")) .Returns(Task.FromResult(new HttpResponseMessage { StatusCode = httpStatusCode, Content = new StringContent("") })); _responseHelper.Setup(rh => rh.JsonPrettyPrint( It.IsAny <HttpResponseMessage>())) .Returns(string.Empty); _faceLogic = new FaceLogic(_faceAPI.Object, _responseHelper.Object); var result = _faceLogic.IdentifyFace(new List <string> { "a" }, "a"); Assert.That(result, Is.TypeOf <string>()); }
public void IdentifyFace_PersonGroupIsNullOrEmpty_ThrowArgumentNullException(string error) { _faceLogic = new FaceLogic(_faceAPI.Object, _responseHelper.Object); Assert.That(() => _faceLogic.IdentifyFace(new List <string>(), error), Throws.ArgumentNullException); }
public void IdentifyFace_FaceIDIsNull_ThrowArgumentNullException() { _faceLogic = new FaceLogic(_faceAPI.Object, _responseHelper.Object); Assert.That(() => _faceLogic.IdentifyFace(null, "a"), Throws.ArgumentNullException); }