public void CreatedNodeHasAppropriateDefaultValues() { PropertyComparisonValidatorNode node = new PropertyComparisonValidatorNode(); Assert.AreEqual(Resources.PropertyComparisonValidatorNodeName, node.Name); Assert.AreEqual(ComparisonOperator.Equal, node.ComparisonOperator); Assert.AreEqual("", node.PropertyToCompare); Assert.AreEqual(false, node.Negated); }
public void CreatedNodeWithValidatorDataHasAppropriateValuesFromData() { PropertyComparisonValidatorData validatorData = new PropertyComparisonValidatorData("name"); validatorData.Negated = true; validatorData.ComparisonOperator = ComparisonOperator.GreaterThanEqual; validatorData.PropertyToCompare = "property"; PropertyComparisonValidatorNode node = new PropertyComparisonValidatorNode(validatorData); Assert.AreEqual("name", node.Name); Assert.AreEqual(ComparisonOperator.GreaterThanEqual, node.ComparisonOperator); Assert.AreEqual("property", node.PropertyToCompare); Assert.AreEqual(true, node.Negated); }
public void NodeCreatesValidatorDataWithValues() { PropertyComparisonValidatorNode node = new PropertyComparisonValidatorNode(); node.Name = "validator"; node.Negated = true; node.ComparisonOperator = ComparisonOperator.GreaterThanEqual; node.PropertyToCompare = "property"; PropertyComparisonValidatorData validatorData = node.CreateValidatorData() as PropertyComparisonValidatorData; Assert.IsNotNull(validatorData); Assert.AreEqual("validator", validatorData.Name); Assert.AreEqual(true, validatorData.Negated); Assert.AreEqual(ComparisonOperator.GreaterThanEqual, validatorData.ComparisonOperator); Assert.AreEqual("property", validatorData.PropertyToCompare); }