public static void TestReturnErrorMessageInIsValid() { var attribute = new ValidationAttributeOverrideTwoArgsIsValid(); var toBeTested = new ToBeTested(); var validationContext = new ValidationContext(toBeTested); validationContext.MemberName = "PropertyToBeTested"; var validationResult = attribute.GetValidationResult(toBeTested, validationContext); Assert.NotNull(validationResult); // validationResult == null would be success // cannot check error message - not defined on ret builds }
public static void TestTwoArgsIsValidValidatesSuccessfully() { var attribute = new ValidationAttributeOverrideTwoArgsIsValid(); attribute.GetValidationResult("Valid Value", s_testValidationContext); }
public static void TestTwoArgsIsValidValidatesSuccessfully() { var attribute = new ValidationAttributeOverrideTwoArgsIsValid(); AssertEx.DoesNotThrow(() => attribute.GetValidationResult("Valid Value", s_testValidationContext)); }