public void ModelValidation_LactateProduction_CannotBeNull() { // Arrange var postDto = new PostLactateResultDto(); // Act var modelValidation = AspHelpers.ValidateDtoProperty(postDto, nameof(postDto.LactateProduction)); // Assert modelValidation.IsValid.ShouldBeFalse(); modelValidation.Results.First().ErrorMessage.ShouldContain($"{nameof(postDto.LactateProduction)} field is required"); }
public void ModelValidation_AnaerobicRespiration_CannotBeLessThanZero() { // Arrange var postDto = new PostLactateResultDto { AnaerobicRespiration = -1 }; // Act var modelValidation = AspHelpers.ValidateDtoProperty(postDto, nameof(postDto.AnaerobicRespiration)); // Assert modelValidation.IsValid.ShouldBeFalse(); modelValidation.Results.First().ErrorMessage.ShouldContain($"{nameof(postDto.AnaerobicRespiration)} must be between 0 and"); }