public void TestProperties_PropertyWithName_HasNoError() { var property = new Properties("asdf"); var testClass = new TestClass(new[] { property }); var validator = new TestClassValidator(); validator.ShouldNotHaveValidationErrorFor(x => x.TestProperties, testClass); }
public void TestProperties_PropertyWithNullName_HasCustomError() { var property = new Properties(null); var testClass = new TestClass(new[] { property }); var validator = new TestClassValidator(); validator.ShouldHaveValidationErrorFor(x => x.TestProperties, testClass).WithErrorMessage($"TestProperty {property.Id} name can't be null or empty"); }