Exemplo n.º 1
0
        public static void ClassInitialize()
        {
            var orchestrate = new Orchestrate(TestHelper.ApiKey);

            var itemList = new List<AggregateTestData>();

            itemList.Add(new AggregateTestData { Category = "TV", Manufacturer = "Sony", ItemName = "Sony TV - Gold", SaleCount = 1, SaleDate = DateTime.UtcNow.AddDays(-7), SalePrice = 399.95, Distance = new Location { Long = -122.674146, Lat =  45.843452 }});
            itemList.Add(new AggregateTestData { Category = "TV", Manufacturer = "Sony", ItemName = "Sony TV - Gold", SaleCount = 1, SaleDate = DateTime.UtcNow.AddDays(-6), SalePrice = 399.95, Distance = new Location { Long = -122.674146, Lat = 45.843452 }});
            itemList.Add(new AggregateTestData { Category = "TV", Manufacturer = "Sony", ItemName = "Sony TV - Gold", SaleCount = 2, SaleDate = DateTime.UtcNow.AddDays(-5), SalePrice = 349.95, Distance = new Location { Long = -122.674146, Lat = 45.843452 }});
            itemList.Add(new AggregateTestData { Category = "TV", Manufacturer = "Sony", ItemName = "Sony TV - Gold", SaleCount = 3, SaleDate = DateTime.UtcNow.AddDays(-4), SalePrice = 349.95, Distance = new Location { Long = -122.674146, Lat = 45.843452 }});
            itemList.Add(new AggregateTestData { Category = "TV", Manufacturer = "Sony", ItemName = "Sony TV - Gold", SaleCount = 3, SaleDate = DateTime.UtcNow.AddDays(-3), SalePrice = 349.95, Distance = new Location { Long = -122.674146, Lat = 45.843452 }});
            itemList.Add(new AggregateTestData { Category = "TV", Manufacturer = "Sony", ItemName = "Sony TV - Gold", SaleCount = 6, SaleDate = DateTime.UtcNow.AddDays(-2), SalePrice = 299.95, Distance = new Location { Long = -122.674146, Lat = 45.843452 }});
            itemList.Add(new AggregateTestData { Category = "TV", Manufacturer = "Sony", ItemName = "Sony TV - Gold", SaleCount = 5, SaleDate = DateTime.UtcNow.AddDays(-1), SalePrice = 299.95, Distance = new Location { Long = -122.674146, Lat = 45.843452 }});
            itemList.Add(new AggregateTestData { Category = "TV", Manufacturer = "Sony", ItemName = "Sony TV - Gold", SaleCount = 7, SaleDate = DateTime.UtcNow.AddDays(0), SalePrice = 299.95, Distance = new Location { Long = -122.674146, Lat = 45.843452 }});

            itemList.Add(new AggregateTestData { Category = "TV", Manufacturer = "Samsung", ItemName = "Samsung TV - Gold", SaleCount = 1, SaleDate = DateTime.UtcNow.AddDays(-7), SalePrice = 399.95, Distance = new Location { Long = -121.674146, Lat = 46.843452 }});
            itemList.Add(new AggregateTestData { Category = "TV", Manufacturer = "Samsung", ItemName = "Samsung TV - Gold", SaleCount = 1, SaleDate = DateTime.UtcNow.AddDays(-6), SalePrice = 399.95, Distance = new Location { Long = -121.674146, Lat = 46.843452 }});
            itemList.Add(new AggregateTestData { Category = "TV", Manufacturer = "Samsung", ItemName = "Samsung TV - Gold", SaleCount = 2, SaleDate = DateTime.UtcNow.AddDays(-5), SalePrice = 349.95, Distance = new Location { Long = -121.674146, Lat = 46.843452 }});
            itemList.Add(new AggregateTestData { Category = "TV", Manufacturer = "Samsung", ItemName = "Samsung TV - Gold", SaleCount = 3, SaleDate = DateTime.UtcNow.AddDays(-4), SalePrice = 349.95, Distance = new Location { Long = -121.674146, Lat = 46.843452 }});
            itemList.Add(new AggregateTestData { Category = "TV", Manufacturer = "Samsung", ItemName = "Samsung TV - Gold", SaleCount = 3, SaleDate = DateTime.UtcNow.AddDays(-3), SalePrice = 349.95, Distance = new Location { Long = -121.674146, Lat = 46.843452 }});
            itemList.Add(new AggregateTestData { Category = "TV", Manufacturer = "Samsung", ItemName = "Samsung TV - Gold", SaleCount = 6, SaleDate = DateTime.UtcNow.AddDays(-2), SalePrice = 299.95, Distance = new Location { Long = -121.674146, Lat = 46.843452 }});
            itemList.Add(new AggregateTestData { Category = "TV", Manufacturer = "Samsung", ItemName = "Samsung TV - Gold", SaleCount = 5, SaleDate = DateTime.UtcNow.AddDays(-1), SalePrice = 299.95, Distance = new Location { Long = -121.674146, Lat = 46.843452 }});
            itemList.Add(new AggregateTestData { Category = "TV", Manufacturer = "Samsung", ItemName = "Samsung TV - Gold", SaleCount = 7, SaleDate = DateTime.UtcNow.AddDays(0), SalePrice = 299.95, Distance = new Location { Long = -121.674146, Lat = 46.843452 }});

            itemList.Add(new AggregateTestData { Category = "TV", Manufacturer = "Samsung", ItemName = "Samsung TV - Silver", SaleCount = 11, SaleDate = DateTime.UtcNow.AddDays(-7), SalePrice = 199.95, Distance = new Location { Long = -120.674146, Lat = 47.843452 }});
            itemList.Add(new AggregateTestData { Category = "TV", Manufacturer = "Samsung", ItemName = "Samsung TV - Silver", SaleCount = 11, SaleDate = DateTime.UtcNow.AddDays(-6), SalePrice = 199.95, Distance = new Location { Long = -120.674146, Lat = 47.843452 }});
            itemList.Add(new AggregateTestData { Category = "TV", Manufacturer = "Samsung", ItemName = "Samsung TV - Silver", SaleCount = 12, SaleDate = DateTime.UtcNow.AddDays(-5), SalePrice = 149.95, Distance = new Location { Long = -120.674146, Lat = 47.843452 }});
            itemList.Add(new AggregateTestData { Category = "TV", Manufacturer = "Samsung", ItemName = "Samsung TV - Silver", SaleCount = 13, SaleDate = DateTime.UtcNow.AddDays(-4), SalePrice = 149.95, Distance = new Location { Long = -120.674146, Lat = 47.843452 }});
            itemList.Add(new AggregateTestData { Category = "TV", Manufacturer = "Samsung", ItemName = "Samsung TV - Silver", SaleCount = 13, SaleDate = DateTime.UtcNow.AddDays(-3), SalePrice = 149.95, Distance = new Location { Long = -120.674146, Lat = 47.843452 }});
            itemList.Add(new AggregateTestData { Category = "TV", Manufacturer = "Samsung", ItemName = "Samsung TV - Silver", SaleCount = 16, SaleDate = DateTime.UtcNow.AddDays(-2), SalePrice = 99.95, Distance = new Location { Long = -120.674146, Lat = 47.843452 }});
            itemList.Add(new AggregateTestData { Category = "TV", Manufacturer = "Samsung", ItemName = "Samsung TV - Silver", SaleCount = 15, SaleDate = DateTime.UtcNow.AddDays(-1), SalePrice = 99.95, Distance = new Location { Long = -120.674146, Lat = 47.843452 }});
            itemList.Add(new AggregateTestData { Category = "TV", Manufacturer = "Samsung", ItemName = "Samsung TV - Silver", SaleCount = 17, SaleDate = DateTime.UtcNow.AddDays(0), SalePrice = 99.95, Distance = new Location { Long = -120.674146, Lat = 47.843452 }});

            itemList.Add(new AggregateTestData { Category = "Computer", Manufacturer = "Dell", ItemName = "DXV - 9000", SaleCount = 4, SaleDate = DateTime.UtcNow.AddDays(-7), SalePrice = 1199.95, Distance = new Location { Long = -119, Lat = 48.843452 }});
            itemList.Add(new AggregateTestData { Category = "Computer", Manufacturer = "Dell", ItemName = "DXV - 9000", SaleCount = 3, SaleDate = DateTime.UtcNow.AddDays(-6), SalePrice = 1199.95, Distance = new Location { Long = -119, Lat = 48.843452 }});
            itemList.Add(new AggregateTestData { Category = "Computer", Manufacturer = "Dell", ItemName = "DXV - 9000", SaleCount = 2, SaleDate = DateTime.UtcNow.AddDays(-5), SalePrice = 1149.95, Distance = new Location { Long = -119, Lat = 48.843452 }});
            itemList.Add(new AggregateTestData { Category = "Computer", Manufacturer = "Dell", ItemName = "DXV - 9000", SaleCount = 1, SaleDate = DateTime.UtcNow.AddDays(-4), SalePrice = 1149.95, Distance = new Location { Long = -119, Lat = 48.843452 }});
            itemList.Add(new AggregateTestData { Category = "Computer", Manufacturer = "Dell", ItemName = "DXV - 9000", SaleCount = 1, SaleDate = DateTime.UtcNow.AddDays(-3), SalePrice = 1149.95, Distance = new Location { Long = -119, Lat = 48.843452 }});
            itemList.Add(new AggregateTestData { Category = "Computer", Manufacturer = "Dell", ItemName = "DXV - 9000", SaleCount = 0, SaleDate = DateTime.UtcNow.AddDays(-2), SalePrice = 1099.95, Distance = new Location { Long = -119, Lat = 48.843452 }});
            itemList.Add(new AggregateTestData { Category = "Computer", Manufacturer = "Dell", ItemName = "DXV - 9000", SaleCount = 3, SaleDate = DateTime.UtcNow.AddDays(-1), SalePrice = 1099.95, Distance = new Location { Long = -119, Lat = 48.843452 }});
            itemList.Add(new AggregateTestData { Category = "Computer", Manufacturer = "Dell", ItemName = "DXV - 9000", SaleCount = 7, SaleDate = DateTime.UtcNow.AddDays(0), SalePrice = 999.95, Distance = new Location { Long = -119, Lat = 48.843452 }});

            foreach (var item in itemList)
            {
                orchestrate.Post(CollectionName, item);
            }

            // need to let Orchestrate get all of these in before starting to test.
            Thread.Sleep(5000);
        }