예제 #1
0
        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>());
        }
예제 #2
0
        public void IdentifyFace_PersonGroupIsNullOrEmpty_ThrowArgumentNullException(string error)
        {
            _faceLogic = new FaceLogic(_faceAPI.Object, _responseHelper.Object);

            Assert.That(() => _faceLogic.IdentifyFace(new List <string>(), error), Throws.ArgumentNullException);
        }
예제 #3
0
        public void IdentifyFace_FaceIDIsNull_ThrowArgumentNullException()
        {
            _faceLogic = new FaceLogic(_faceAPI.Object, _responseHelper.Object);

            Assert.That(() => _faceLogic.IdentifyFace(null, "a"), Throws.ArgumentNullException);
        }