// Hip circumference can be null if gender is male public void HipCircumferenceAndGenderTypeIsMaleTests() { var userAccessorMock = new Mock <IUserAccessor>(); userAccessorMock.Setup(x => x.GetCurrentUsersGender()).Returns(GenderType.Male); CreateOrEditBodyMeasurementRequestValidator validator = new CreateOrEditBodyMeasurementRequestValidator(userAccessorMock.Object); validator.ShouldNotHaveValidationErrorFor(x => x.HipCircumference, (double?)null); validator.ShouldNotHaveValidationErrorFor(x => x.HipCircumference, (double?)0); validator.ShouldNotHaveValidationErrorFor(x => x.HipCircumference, (double?)10.4); }