Beispiel #1
0
        public void CreatedNodeHasAppropriateDefaultValues()
        {
            DomainValidatorNode node = new DomainValidatorNode();

            DomainValidatorData validatorData = node.CreateValidatorData() as DomainValidatorData;

            Assert.IsNotNull(validatorData);
            Assert.AreEqual(Resources.DomainValidatorNodeName, validatorData.Name);
            Assert.AreEqual(false, validatorData.Negated);
            Assert.AreEqual(0, validatorData.Domain.Count);

            Assert.AreEqual(Resources.DomainValidatorNodeName, node.Name);
            Assert.AreEqual(false, node.Negated);
            Assert.AreEqual(0, node.Domain.Count);
        }
Beispiel #2
0
        public void NodeCreatesValidatorDataWithValues()
        {
            DomainValidatorNode node = new DomainValidatorNode();

            node.Name    = "validator";
            node.Negated = true;
            node.Domain.Add(new DomainValue("1"));
            node.Domain.Add(new DomainValue("2"));
            node.Domain.Add(new DomainValue("3"));

            DomainValidatorData validatorData = node.CreateValidatorData() as DomainValidatorData;

            Assert.IsNotNull(validatorData);
            Assert.AreEqual("validator", validatorData.Name);
            Assert.AreEqual(true, validatorData.Negated);
            Assert.AreEqual(3, validatorData.Domain.Count);
        }