public void RRequiredAttributeDisplayValueCorrect() { var result = new RRequiredAttribute().Validate(() => new { Property = default(RRequiredAttributeTests) }, "Property", "Class"); Assert.IsNotNull(result); Assert.IsTrue(result.ErrorMessage.Contains("Class")); }
public void RRequiredAttributeNullableTypeNegative() { var result = new RRequiredAttribute().Validate(() => new { Property = default(int?) }, "Property"); Assert.IsNotNull(result); }
public void RRequiredAttributeNullableTypePositive() { var result = new RRequiredAttribute().Validate(() => new { Property = (int?)10 }, "Property"); Assert.IsNull(result); }
public void RRequiredAttributeReferenceTypeNegative() { var result = new RRequiredAttribute().Validate(() => new { Property = default(RRequiredAttributeTests) }, "Property"); Assert.IsNotNull(result); }
public void RRequiredAttributeReferenceTypePositive() { var result = new RRequiredAttribute().Validate(() => new { Property = new { SomeProperty = 20 } }, "Property"); Assert.IsNull(result); }