Beispiel #1
0
        public void Validate_ReturnFalse_WhenDataIsInvalid()
        {
            var query = new GetOneQuery
            {
                Id = 0,
            };

            var validator = new GetOneQueryValidator(_configConstants);
            var result    = validator.Validate(query);

            result.IsValid.ShouldBeFalse();
        }
Beispiel #2
0
        public void Validate_ReturnErrorMessage_WhenDataIsInvalid()
        {
            var query = new GetOneQuery
            {
                Id = 0,
            };

            var validator = new GetOneQueryValidator(_configConstants);
            var result    = validator.Validate(query);

            result.Errors.FirstOrDefault(x => x.ErrorMessage == _configConstants.INVALID_TENDER_ID)?.ErrorMessage.ShouldBe(_configConstants.INVALID_TENDER_ID);
            result.IsValid.ShouldBeFalse();
        }