public void ShouldGetOneProblemWithReplyActionWithOneWayOperation()
        {
            NoReplyActionWithOneWayOperation rule = new NoReplyActionWithOneWayOperation();
            TypeNode typeNode = RuleHelper.GetTypeNodeFromType(typeof(IReplyActionWithOneWay));

            rule.Check(RuleHelper.GetMemberForOperation(typeNode, "Operation"));

            Assert.AreEqual(1, rule.Problems.Count);
        }
Beispiel #2
0
        public void ShouldGetOneProblemWithNoOperationContractValuesDeclared()
        {
            InconsistentServiceContract rule = new InconsistentServiceContract();
            TypeNode typeNode = RuleHelper.GetTypeNodeFromType(typeof(INoOperationContractValuesDeclared));

            rule.Check(typeNode);
            Assert.AreEqual(0, rule.Problems.Count);

            rule.Check(RuleHelper.GetMemberForOperation(typeNode, "Operation"));
            Assert.AreEqual(1, rule.Problems.Count);
        }
Beispiel #3
0
        public void ShouldGetOneProblemWithNotAllowedSessionDeclared()
        {
            InconsistentServiceContract rule = new InconsistentServiceContract();
            TypeNode typeNode = RuleHelper.GetTypeNodeFromType(typeof(INotAllowedSessionDeclared));

            rule.Check(typeNode);

            Assert.AreEqual(0, rule.Problems.Count);

            rule.Check(RuleHelper.GetMemberForOperation(typeNode, "Operation"));
            Assert.AreEqual(1, rule.Problems.Count);
            Assert.AreEqual("remove", rule.Problems[0].Resolution.Items[0]);
        }
        public void ShouldResetUnmatchedMessageHandlerFlag()
        {
            MultipleUnmatchedMessageHandlers rule = new MultipleUnmatchedMessageHandlers();
            TypeNode typeNode = RuleHelper.GetTypeNodeFromType(typeof(IMultipleUnmatchedMessageHandlers));

            rule.Check(RuleHelper.GetMemberForOperation(typeNode, "Operation1"));
            rule.Check(RuleHelper.GetMemberForOperation(typeNode, "Operation3"));

            Assert.AreEqual(1, rule.Problems.Count);
            rule.Check(typeNode);

            rule.Check(RuleHelper.GetMemberForOperation(typeNode, "Operation1"));
            Assert.AreEqual(1, rule.Problems.Count);
        }