public void ClassWithDataMemberIsRequiredTrueWithoutDataContract_NoValidator() { // Arrange var provider = new DataMemberModelValidatorProvider(); var metadata = _metadataProvider.GetMetadataForProperty(() => null, typeof(ClassWithDataMemberIsRequiredTrueWithoutDataContract), "TheProperty"); // Act var validators = provider.GetValidators(metadata); // Assert Assert.Empty(validators); }
public void ClassWithoutAttributes_NoValidator() { // Arrange var provider = new DataMemberModelValidatorProvider(); var metadata = _metadataProvider.GetMetadataForProperty(() => null, typeof(ClassWithoutAttributes), "TheProperty"); // Act var validators = provider.GetValidators(metadata); // Assert Assert.Empty(validators); }
public void ClassWithDataMemberIsRequiredTrueWithoutDataContract_NoValidator() { // Arrange var provider = new DataMemberModelValidatorProvider(); var metadata = _metadataProvider.GetMetadataForProperty(() => null, typeof(ClassWithDataMemberIsRequiredTrueWithoutDataContract), "TheProperty"); // Act var validators = provider.GetValidators(metadata); // Assert Assert.Empty(validators); }
public void ClassWithoutAttributes_NoValidator() { // Arrange var provider = new DataMemberModelValidatorProvider(); var metadata = _metadataProvider.GetMetadataForProperty(() => null, typeof(ClassWithoutAttributes), "TheProperty"); // Act var validators = provider.GetValidators(metadata); // Assert Assert.Empty(validators); }
public void ClassWithDataMemberIsRequiredTrue_Validator() { // Arrange var provider = new DataMemberModelValidatorProvider(); var metadata = _metadataProvider.GetMetadataForProperty(() => null, typeof(ClassWithDataMemberIsRequiredTrue), "TheProperty"); // Act var validators = provider.GetValidators(metadata); // Assert var validator = Assert.Single(validators); Assert.True(validator.IsRequired); }
public void ClassWithDataMemberIsRequiredTrue_Validator() { // Arrange var provider = new DataMemberModelValidatorProvider(); var metadata = _metadataProvider.GetMetadataForProperty(() => null, typeof(ClassWithDataMemberIsRequiredTrue), "TheProperty"); // Act var validators = provider.GetValidators(metadata); // Assert var validator = Assert.Single(validators); Assert.True(validator.IsRequired); }