Example #1
0
        public async Task ShouldHashRequest(HashRequestModel requestModel)
        {
            //arrange
            string validationMessage = "Validation Successful";

            _reqValidation.Setup(u => u.ValidateLoginRequest(requestModel, out validationMessage))
            .Returns(true);

            _funcService.Setup(u => u.Hash(It.IsAny <HashRequestModel>()))
            .Returns(() => Task.FromResult(responseModel));

            //act
            var response = await _hashManager.HashAsync(requestModel);

            //assert
            _reqValidation.Verify(u => u.ValidateLoginRequest(It.IsAny <HashRequestModel>(), out validationMessage), Times.Once);

            _funcService.Verify(u => u.Hash(It.IsAny <HashRequestModel>()), Times.Once);

            Assert.NotNull(response);

            Assert.NotNull(response.hash_value);
        }