public void TestValidateClassThrowsContractException() { var sut = new BaseDtoImplementation1 { RequiredStringProperty1 = "arbitrary-value" }; sut.Validate("RequiredStringProperty2"); }
public void TestValidateSinglePropertySucceeds() { var sut = new BaseDtoImplementation1 { RequiredStringProperty1 = "arbitrary-value" }; sut.Validate("RequiredStringProperty1"); }
public void TestGetValidationResultsSinglePropertyAndValueSucceeds() { var sut = new BaseDtoImplementation1 { RequiredStringProperty1 = "arbitrary-value" }; var validationResults2 = sut.GetValidationResults("RequiredStringProperty2", null); Assert.AreEqual(1, validationResults2.Count); }
public void TestGetErrorMessagesSinglePropertyAndValueSucceeds() { var sut = new BaseDtoImplementation1 { RequiredStringProperty1 = "arbitrary-value" }; var errorMessages2 = sut.GetErrorMessages("RequiredStringProperty2", null); Assert.AreEqual(1, errorMessages2.Count); }
public void TestIsValidSinglePropertyAndValueSucceeds() { var sut = new BaseDtoImplementation1 { RequiredStringProperty1 = "arbitrary-value" }; var isValidProperty2 = sut.IsValid("RequiredStringProperty2", null); Assert.IsFalse(isValidProperty2); }
public void TestIsValidSinglePropertySucceeds() { var sut = new BaseDtoImplementation1 { RequiredStringProperty1 = "arbitrary-value" }; var isValidProperty1 = sut.IsValid("RequiredStringProperty1"); Assert.IsTrue(isValidProperty1); var isValidProperty2 = sut.IsValid("RequiredStringProperty2"); Assert.IsFalse(isValidProperty2); var isValidClass = sut.IsValid(); Assert.IsFalse(isValidClass); }