public void ReturnSucceedForIsWrappedWithOneBodyPart()
        {
            Message mc = CreateMessageContract();
            PrimitiveMessagePart part = CreatePrimitiveMessagePart();
            mc.MessageParts.Add(part);

            TestIsWrappedValidator validator = new TestIsWrappedValidator();
            ValidationResults validationResults = new ValidationResults();

            validator.TestDoValidate(false, mc, "IsWrapped", validationResults);

            Assert.IsTrue(validationResults.IsValid);
        }
Exemplo n.º 2
0
        public void ReturnSucceedForIsWrappedWithOneBodyPart()
        {
            Message mc = CreateMessageContract();
            PrimitiveMessagePart part = CreatePrimitiveMessagePart();

            mc.MessageParts.Add(part);

            TestIsWrappedValidator validator         = new TestIsWrappedValidator();
            ValidationResults      validationResults = new ValidationResults();

            validator.TestDoValidate(false, mc, "IsWrapped", validationResults);

            Assert.IsTrue(validationResults.IsValid);
        }
        public void ReturnFailureForIsWrappedWithBodyParts()
        {
            Message mc = CreateMessageContract();
            PrimitiveMessagePart part = CreatePrimitiveMessagePart();
            PrimitiveMessagePart part2 = CreatePrimitiveMessagePart();
            part2.Name = "Part2";
            
            mc.MessageParts.Add(part);
            mc.MessageParts.Add(part2);

            TestIsWrappedValidator validator = new TestIsWrappedValidator();
            ValidationResults validationResults = new ValidationResults();

            validator.TestDoValidate(false, mc, "IsWrapped", validationResults);

            Assert.IsFalse(validationResults.IsValid);
        }
Exemplo n.º 4
0
        public void ReturnFailureForIsWrappedWithBodyParts()
        {
            Message mc = CreateMessageContract();
            PrimitiveMessagePart part  = CreatePrimitiveMessagePart();
            PrimitiveMessagePart part2 = CreatePrimitiveMessagePart();

            part2.Name = "Part2";

            mc.MessageParts.Add(part);
            mc.MessageParts.Add(part2);

            TestIsWrappedValidator validator         = new TestIsWrappedValidator();
            ValidationResults      validationResults = new ValidationResults();

            validator.TestDoValidate(false, mc, "IsWrapped", validationResults);

            Assert.IsFalse(validationResults.IsValid);
        }