Ejemplo n.º 1
0
            public void Run(RegressionEnvironment env)
            {
                var fields  = "c0,c1,c2,c3,c4,c5,c6,c7".SplitCsv();
                var builder = new SupportEvalBuilder("SupportEventWithManyArray")
                              .WithExpression("c0", "IntOne=IntTwo")
                              .WithExpression("c1", "IntOne is IntTwo")
                              .WithExpression("c2", "IntBoxedOne=IntBoxedTwo")
                              .WithExpression("c3", "IntBoxedOne is IntBoxedTwo")
                              .WithExpression("c4", "Int2DimOne=Int2DimTwo")
                              .WithExpression("c5", "Int2DimOne is Int2DimTwo")
                              .WithExpression("c6", "ObjectOne=ObjectTwo")
                              .WithExpression("c7", "ObjectOne is ObjectTwo");

                var array = new SupportEventWithManyArray("E1")
                            .WithIntOne(new[] { 1, 2 })
                            .WithIntTwo(new[] { 1, 2 })
                            .WithIntBoxedOne(new int?[] { 1, 2 })
                            .WithIntBoxedTwo(new int?[] { 1, 2 })
                            .WithObjectOne(new object[] { 'a', new object[] { 1 } })
                            .WithObjectTwo(new object[] { 'a', new object[] { 1 } })
                            .WithInt2DimOne(new[] { new[] { 1, 2 }, new[] { 3, 4 } })
                            .WithInt2DimTwo(new[] { new[] { 1, 2 }, new[] { 3, 4 } });

                builder.WithAssertion(array).Expect(fields, true, true, true, true, true, true, true, true);

                array = new SupportEventWithManyArray("E1")
                        .WithIntOne(new[] { 1, 2 })
                        .WithIntTwo(new[] { 1 })
                        .WithIntBoxedOne(new int?[] { 1, 2 })
                        .WithIntBoxedTwo(new int?[] { 1 })
                        .WithObjectOne(new object[] { 'a', 2 })
                        .WithObjectTwo(new object[] { 'a' })
                        .WithInt2DimOne(new[] { new[] { 1, 2 }, new[] { 3, 4 } })
                        .WithInt2DimTwo(new[] { new[] { 1, 2 }, new[] { 3 } });
                builder.WithAssertion(array).Expect(fields, false, false, false, false, false, false, false, false);

                builder.Run(env);
                env.UndeployAll();
            }
Ejemplo n.º 2
0
            public void Run(RegressionEnvironment env)
            {
                string epl =
                    "@Name('s0') select IntArrayCollection.distinctOf() as c0, IntArrayCollection.distinctOf(v => v) as c1 from SupportEventWithManyArray";

                env.CompileDeploy(epl).AddListener("s0");

                ICollection <int[]> coll = new List <int[]>();

                coll.Add(new[] { 1, 2 });
                coll.Add(new[] { 2 });
                coll.Add(new[] { 1, 2 });
                coll.Add(new[] { 2 });
                SupportEventWithManyArray @event = new SupportEventWithManyArray().WithIntArrayCollection(coll);

                env.SendEventBean(@event);
                EventBean received = env.Listener("s0").AssertOneGetNewAndReset();

                AssertField(received, "c0");
                AssertField(received, "c1");

                env.UndeployAll();
            }