private static void AssertList(
            SupportListener listener,
            params SupportBean[] events)
        {
            var @out = listener.AssertOneGetNewAndReset().Get("c0").UnwrapIntoArray <object>();

            EPAssertionUtil.AssertEqualsExactOrder(@out, events);
        }
        private static void AssertReceived(
            SupportListener listener,
            object[][] values)
        {
            var @event = listener.AssertOneGetNewAndReset();
            var events = (EventBean[]) @event.GetFragment("detail");
            if (values == null) {
                Assert.IsNull(events);
                return;
            }

            EPAssertionUtil.AssertPropsPerRowAnyOrder(events, new [] { "c0", "c1" }, values);
        }
Exemplo n.º 3
0
 public static void AssertRectanglesSingleValue(
     RegressionEnvironment env,
     SupportListener listener,
     IList<BoundingBox> rectangles,
     params string[] matches)
 {
     for (var i = 0; i < rectangles.Count; i++) {
         var box = rectangles[i];
         SendRectangle(env, "R" + box, box.MinX, box.MinY, box.MaxX - box.MinX, box.MaxY - box.MinY);
         var c0 = listener.AssertOneGetNewAndReset().Get("c0").ToString();
         Assert.AreEqual(matches[i], c0, "for box " + i);
     }
 }
Exemplo n.º 4
0
 public static void SendAssertWNull(
     RegressionEnvironment env,
     SupportListener listener,
     double? px,
     double? py,
     double? x,
     double? y,
     double? width,
     double? height,
     bool? expected)
 {
     env.SendEventBean(new SupportEventRectangleWithOffset("E", px, py, x, y, width, height));
     Assert.AreEqual(expected, listener.AssertOneGetNewAndReset().Get("c0"));
 }
Exemplo n.º 5
0
 private static void AssertReceived(
     SupportListener listenerStmtOne,
     SupportBean[] beans,
     int[] indexesAll,
     int[] indexesWhere,
     string[] mapKeys,
     object[] mapValues)
 {
     var received = listenerStmtOne.AssertOneGetNewAndReset();
     EPAssertionUtil.AssertEqualsExactOrder(
         SupportBean.GetBeansPerIndex(beans, indexesAll),
         (object[]) received.Get("c0"));
     EPAssertionUtil.AssertEqualsExactOrder(
         SupportBean.GetBeansPerIndex(beans, indexesWhere),
         (ICollection<object>) received.Get("c1"));
     EPAssertionUtil.AssertPropsMap((IDictionary<object, object>) received.Get("c2"), mapKeys, mapValues);
 }
Exemplo n.º 6
0
        public static void SendAssertSpatialAABB(
            RegressionEnvironment env,
            SupportListener listener,
            int numX,
            int numY,
            long deltaMSec)
        {
            var start = PerformanceObserver.MilliTime;
            for (var x = 0; x < numX; x++) {
                for (var y = 0; y < numY; y++) {
                    env.SendEventBean(new SupportSpatialAABB("", x, y, 0.1, 0.1));
                    listener.AssertOneGetNewAndReset();
                }
            }

            var delta = PerformanceObserver.MilliTime - start;
            Assert.That(delta, Is.LessThan(deltaMSec), "Delta: " + delta);
        }