Beispiel #1
0
        public void FetchTests()
        {
            List <RoutingRule> oRules;
            var res = RoutingRule.GetRoutingRules(_connectionServer, out oRules, 1, 10, null);

            Assert.IsTrue(res.Success, "Fetching routing rules failed:" + res);
            Assert.IsTrue(oRules.Count > 0, "No rules returned in fetch:" + res);

            RoutingRule oRule = oRules[0];

            Console.WriteLine(oRule.ToString());
            Console.WriteLine(oRule.DumpAllProps("--->"));

            RoutingRule oTest;

            res = RoutingRule.GetRoutingRule(out oTest, _connectionServer, oRule.ObjectId);
            Assert.IsTrue(res.Success, "Failed to create routing rule with valid ObjectId:" + res);
            Assert.IsTrue(oTest.ObjectId.Equals(oRule.ObjectId), "Fetched routing rule does not match objectId");

            res = RoutingRule.GetRoutingRule(out oTest, _connectionServer, "", oRule.DisplayName);
            Assert.IsTrue(res.Success, "Failed to create routing rule with valid display name:" + res);
            Assert.IsTrue(oTest.ObjectId.Equals(oRule.ObjectId), "Fetched routing rule does not match objectId");

            res = oTest.RefetchRoutingRuleData();
            Assert.IsTrue(res.Success, "Failed to refetch routing rule data");

            res = RoutingRule.GetRoutingRules(_connectionServer, out oRules, 1, 10, "query=(ObjectId is Bogus)");
            Assert.IsTrue(res.Success, "fetching rules with invalid query should not fail:" + res);
            Assert.IsTrue(oRules.Count == 0, "Invalid query string should return an empty rule list:" + oRules.Count);
        }
Beispiel #2
0
        public void RoutingRule_Constructor_Default_Success()
        {
            RoutingRule oTemp = new RoutingRule();

            Console.WriteLine(oTemp.ToString());
            Console.WriteLine(oTemp.DumpAllProps());
        }