private void AssertReceived(
                RegressionEnvironment env,
                IDictionary <string, object> expected)
            {
                var received = env.Listener("s0")
                               .AssertOneGetNewAndReset().Get("c0")
                               .UnwrapStringDictionary();

                Assert.AreEqual(expected.Count, received.Count);
                foreach (var expectedEntry in expected)
                {
                    var eventsExpected = expectedEntry.Value.UnwrapIntoList <IDictionary <string, object> >();
                    var eventsReceived = received.Get(expectedEntry.Key).UnwrapIntoList <IDictionary <string, object> >();
                    EPAssertionUtil.AssertEqualsAllowArray("failed to compare", eventsExpected.ToArray(), eventsReceived.ToArray());
                }
            }
示例#2
0
        public static void AssertState(params ContextState[] descs)
        {
            Assert.AreEqual(descs.Length, state.Count);
            int count = -1;

            foreach (ContextState desc in descs)
            {
                count++;
                String text = "failed at descriptor " + count;
                ContextStatePathValue value = state.Get(new ContextStatePathKey(desc.Level, desc.ParentPath, desc.Subpath));
                Assert.AreEqual(desc.AgentInstanceId, (int)value.OptionalContextPartitionId, text);
                Assert.AreEqual(desc.IsStarted ? ContextPartitionState.STARTED : ContextPartitionState.STOPPED, value.State, text);

                Object payloadReceived = ContextStateCacheNoSave.DEFAULT_SPI_TEST_BINDING.ByteArrayToObject(value.Blob, null);
                if (desc.Payload == null)
                {
                    Assert.NotNull(payloadReceived);
                }
                else
                {
                    EPAssertionUtil.AssertEqualsAllowArray(text, desc.Payload, payloadReceived);
                }
            }
        }
 public override void AssertValue(
     string message,
     object actual)
 {
     EPAssertionUtil.AssertEqualsAllowArray(message, _expected, actual);
 }