public void TestI_DescribeTransformCode()
        {
            using (var env = EnvHelper.NewTestEnvironment())
            {
                var inputs = InputOutput.CreateInputs();
                var data   = env.CreateStreamingDataView(inputs);
                var args   = new DescribeTransform.Arguments()
                {
                    columns = new[] { "X" }
                };
                var tr = new DescribeTransform(env, args, data);

                var values = new List <int>();
                using (var cursor = tr.GetRowCursor(i => true))
                {
                    var columnGetter = cursor.GetGetter <int>(1);
                    while (cursor.MoveNext())
                    {
                        int got = 0;
                        columnGetter(ref got);
                        values.Add((int)got);
                    }
                }
                Assert.AreEqual(values.Count, 4);
            }
        }
예제 #2
0
        public void TestI_DescribeTransformCode()
        {
            /*using (*/ var env = EnvHelper.NewTestEnvironment();
            {
                var inputs = InputOutput.CreateInputs();
                var data   = DataViewConstructionUtils.CreateFromEnumerable(env, inputs);
                var args   = new DescribeTransform.Arguments()
                {
                    columns = new[] { "X" }
                };
                var tr = new DescribeTransform(env, args, data);

                var values = new List <int>();
                using (var cursor = tr.GetRowCursor(tr.Schema))
                {
                    var columnGetter = cursor.GetGetter <int>(SchemaHelper._dc(1, cursor));
                    while (cursor.MoveNext())
                    {
                        int got = 0;
                        columnGetter(ref got);
                        values.Add((int)got);
                    }
                }
                Assert.AreEqual(values.Count, 4);
            }
        }