Exemplo n.º 1
0
        public static void AssertPlanSingle(SupportFilterPlan expected)
        {
            if (_entries.Count != 1) {
                Assert.Fail("Zero or multiple entries");
            }

            AssertPlan(expected, _entries[0].Plan);
        }
Exemplo n.º 2
0
        public static void AssertPlanSingleByType(
            string eventTypeName,
            SupportFilterPlan expected)
        {
            SupportFilterPlanEntry found = null;
            foreach (var entry in _entries) {
                if (entry.EventType.Name.Equals(eventTypeName)) {
                    if (found != null) {
                        Assert.Fail("found multiple for type " + eventTypeName);
                    }

                    found = entry;
                }
            }

            if (found == null) {
                Assert.Fail("No entry for type " + eventTypeName);
            }

            AssertPlan(expected, found.Plan);
        }
Exemplo n.º 3
0
        public static void AssertPlan(
            SupportFilterPlan expected,
            FilterSpecPlanForge received)
        {
            Assert.AreEqual(expected.Paths.Length, received.Paths.Length);
            AssertExpressionOpt(expected.ControlConfirm, received.FilterConfirm);
            AssertExpressionOpt(expected.ControlNegate, received.FilterNegate);

            var pathsReceived = new List<FilterSpecPlanPathForge>(Arrays.AsList(received.Paths));
            for (var i = 0; i < expected.Paths.Length; i++) {
                var pathExpected = expected.Paths[i];

                var path = FindPath(pathExpected, pathsReceived);
                if (path == null) {
                    Assert.Fail("Failed to find path: " + pathExpected);
                }

                pathsReceived.Remove(path);
                AssertPlanPath(pathExpected, path);
            }
        }