Ejemplo n.º 1
0
        public void Returns_Error_If_Input_Is_Not_In_Range()
        {
            //ACT
            var result = sut.Validate("a");

            //Assert
            Assert.IsTrue(result.HasError);
        }
Ejemplo n.º 2
0
        public IResponseModel FillModel(IInputModel model)
        {
            var result = money2WordConvertor.Money2Word(model?.Amount);

            if (result.HasError)
            {
                responseModel.ErrorMessage = result.Word;
                return(responseModel);
            }
            else
            {
                responseModel.Amount = result.Word;
            }

            var nameValidationResult = nameValidator.Validate(model?.Name);

            if (nameValidationResult.HasError)
            {
                responseModel.ErrorMessage = nameValidationResult.NameResult;
            }
            else
            {
                responseModel.Name = nameValidationResult.NameResult;
            }

            return(responseModel);
        }