Ejemplo n.º 1
0
        public void AggregateCostPerProduct()
        {
            using (CostPerProductAggregation aggregation = new CostPerProductAggregation())
            {
                IEnumerable <Row> result = aggregation.Execute(rows);
                List <Row>        items  = new List <Row>(result);
                Assert.Equal(3, items.Count);
                Assert.Equal("milk", items[0]["name"]);
                Assert.Equal("sugar", items[1]["name"]);
                Assert.Equal("coffee", items[2]["name"]);

                Assert.Equal(30, items[0]["cost"]);
                Assert.Equal(28, items[1]["cost"]);
                Assert.Equal(6, items[2]["cost"]);
            }
        }
Ejemplo n.º 2
0
        public void AggregateCostPerProduct()
        {
            using (CostPerProductAggregation aggregation = new CostPerProductAggregation())
            {
                IEnumerable<Row> result = aggregation.Execute(rows);
                List<Row> items = new List<Row>(result);
                Assert.AreEqual(3, items.Count);
                Assert.AreEqual("milk", items[0]["name"]);
                Assert.AreEqual("sugar", items[1]["name"]);
                Assert.AreEqual("coffee", items[2]["name"]);

                Assert.AreEqual(30, items[0]["cost"]);
                Assert.AreEqual(28, items[1]["cost"]);
                Assert.AreEqual(6, items[2]["cost"]);
            }
        }
Ejemplo n.º 3
0
        public async Task AggregateCostPerProduct()
        {
            using (CostPerProductAggregation aggregation = new CostPerProductAggregation())
            {
                IAsyncEnumerable <Row> result = aggregation.Execute(rows.ToAsyncEnumerable());
                List <Row>             items  = await result.ToListAsync();

                Assert.Equal(3, items.Count);
                Assert.Equal("milk", items[0]["name"]);
                Assert.Equal("sugar", items[1]["name"]);
                Assert.Equal("coffee", items[2]["name"]);

                Assert.Equal(30, items[0]["cost"]);
                Assert.Equal(28, items[1]["cost"]);
                Assert.Equal(6, items[2]["cost"]);
            }
        }