public void DeleteCollectionNoNameAsync() { // Set up const string collectionName = "TestCollection04"; var orchestration = new Orchestrate(TestHelper.ApiKey); var item = new TestData { Id = 1, Value = "DeleteCollection" }; var json = JsonConvert.SerializeObject(item); try { var result = orchestration.CreateCollectionAsync(collectionName, Guid.NewGuid().ToString(), json).Result; var deleteResult = orchestration.DeleteCollectionAsync(string.Empty).Result; } catch (AggregateException ex) { var inner = ex.InnerExceptions.First() as ArgumentNullException; Assert.IsTrue(inner.ParamName == "collectionName"); orchestration.DeleteCollection(collectionName); return; } Assert.Fail("No Exception Thrown"); }
public static void ClassCleanUp() { var orchestrate = new Orchestrate(TestHelper.ApiKey); orchestrate.DeleteCollection(CollectionName); orchestrate.DeleteCollection("GraphTestCollection2"); orchestrate.DeleteCollection("GraphTestCollection3"); }
public void CreateCollectionWithItemAsJsonString() { // Set up const string collectionName = "TestCollection02"; var orchestration = new Orchestrate(ApiKey); var item = new TestData { Id = 1, Value = "CreateCollectionWithItemAsJsonString" }; var json = JsonConvert.SerializeObject(item); try { var result = orchestration.CreateCollection(collectionName, Guid.NewGuid().ToString(), json); Assert.IsTrue(result.Path.Ref.Length > 0); } catch (Exception ex) { Assert.Fail(ex.Message); } finally { orchestration.DeleteCollection(collectionName); } }
public static void ClassInitialize() { var orchestrate = new Orchestrate(TestHelper.ApiKey); var item = new TestData {Id = 1, Value = "Inital Test Item"}; orchestrate.Put(CollectionName, "1", item); }
public static void ClassInitialize() { var orchestrate = new Orchestrate(TestHelper.ApiKey); var item = new TestData { Id = 1, Value = "Inital Test Item" }; orchestrate.CreateCollection(CollectionName, "1", item); }
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); }
public void DeleteNonExistantCollection() { // Set up var orchestration = new Orchestrate(ApiKey); try { var result = orchestration.DeleteCollection("NonExistantCollection"); Assert.IsTrue(result.Path.Collection.Length > 0); } catch (Exception ex) { Assert.Fail(ex.Message); } }
public static void ClassInitialize(TestContext context) { var orchestrate = new Orchestrate(ApiKey); var item = new TestData { Id = 1, Value = "Inital Test Item" }; var item2 = new TestData { Id = 2, Value = "Inital Test Item #2" }; var item3 = new TestData { Id = 3, Value = "Inital Test Item #3" }; orchestrate.CreateCollection(CollectionName, "1", item); orchestrate.Put(CollectionName, "2", item2); orchestrate.Put(CollectionName, "3", item3); }
public void CreateCollectionNoItem() { // Set up const string collectionName = "TestCollection05"; var orchestration = new Orchestrate(ApiKey); try { orchestration.CreateCollection(collectionName, Guid.NewGuid().ToString(), null); } catch (ArgumentNullException ex) { Assert.IsTrue(ex.ParamName == "item"); return; } orchestration.DeleteCollection(collectionName); Assert.Fail("No Exception Thrown"); }
public void CreateCollectionNoItemAsync() { // Set up const string collectionName = "TestCollection05"; var orchestration = new Orchestrate(TestHelper.ApiKey); try { var result = orchestration.CreateCollectionAsync(collectionName, Guid.NewGuid().ToString(), (object)null).Result; } catch (AggregateException ex) { var inner = ex.InnerExceptions.First() as ArgumentNullException; Assert.IsTrue(inner.ParamName == "item"); return; } orchestration.DeleteCollection(collectionName); Assert.Fail("No Exception Thrown"); }
public void CreateCollectionNoCollectionName() { // Set up const string collectionName = ""; var orchestration = new Orchestrate(ApiKey); var item = new TestData { Id = 1, Value = "CreateCollectionNoCollectionName" }; try { orchestration.CreateCollection(collectionName, Guid.NewGuid().ToString(), item); } catch (ArgumentNullException ex) { Assert.IsTrue(ex.ParamName == "collectionName"); return; } Assert.Fail("No Exception Thrown"); }
public void CreateCollectionNoCollectionNameAsync() { // Set up const string collectionName = ""; var orchestration = new Orchestrate(TestHelper.ApiKey); var item = new TestData { Id = 1, Value = "CreateCollectionNoCollectionName" }; try { var result = orchestration.CreateCollectionAsync(collectionName, Guid.NewGuid().ToString(), item).Result; } catch (AggregateException ex) { var inner = ex.InnerExceptions.First() as ArgumentNullException; Assert.IsTrue(inner.ParamName == "collectionName"); return; } Assert.Fail("No Exception Thrown"); }
public void CreateCollectionWithItemAsObjectAsync() { // Set up const string collectionName = "TestCollection01"; var orchestration = new Orchestrate(TestHelper.ApiKey); var item = new TestData {Id = 1, Value = "CreateCollectionWithItemAsObject"}; try { var result = orchestration.PutAsync(collectionName, Guid.NewGuid().ToString(), item).Result; Assert.IsTrue(result.Path.Ref.Length > 0); } catch (Exception ex) { Assert.Fail(ex.Message); } finally { orchestration.DeleteCollection(collectionName); } }
public void CreateCollectionNoKey() { // Set up const string collectionName = "TestCollection04"; var orchestration = new Orchestrate(ApiKey); var item = new TestData { Id = 1, Value = "CreateCollectionNoCollectionName" }; try { orchestration.CreateCollection(collectionName, string.Empty, item); } catch (ArgumentNullException ex) { Assert.IsTrue(ex.ParamName == "key"); return; } orchestration.DeleteCollection(collectionName); Assert.Fail("No Exception Thrown"); }
public void DeleteCollectionAsync() { // Set up const string collectionName = "TestCollection03"; var orchestration = new Orchestrate(TestHelper.ApiKey); var item = new TestData { Id = 1, Value = "DeleteCollection" }; var json = JsonConvert.SerializeObject(item); try { orchestration.CreateCollection(collectionName, Guid.NewGuid().ToString(), json); var result = orchestration.DeleteCollectionAsync(collectionName).Result; Assert.IsTrue(result.Path.Collection.Length > 0); } catch (Exception ex) { Assert.Fail(ex.Message); } }
public void CreateCollectionNoKeyAsync() { // Set up const string collectionName = "TestCollection04"; var orchestration = new Orchestrate(TestHelper.ApiKey); var item = new TestData { Id = 1, Value = "CreateCollectionNoCollectionName" }; try { var result = orchestration.CreateCollectionAsync(collectionName, string.Empty, item).Result; } catch (AggregateException ex) { var inner = ex.InnerExceptions.First() as ArgumentNullException; Assert.IsTrue(inner.ParamName == "key"); return; } orchestration.DeleteCollection(collectionName); Assert.Fail("No Exception Thrown"); }
public void CreateCollectionWithItemAsJsonString() { // Set up const string collectionName = "TestCollection02"; var orchestration = new Orchestrate(TestHelper.ApiKey); var item = new TestData {Id = 1, Value = "CreateCollectionWithItemAsJsonString"}; var json = JsonConvert.SerializeObject(item); try { var result = orchestration.Put(collectionName, Guid.NewGuid().ToString(), json); Assert.IsTrue(result.Path.Ref.Length > 0); } catch (Exception ex) { Assert.Fail(ex.Message); } finally { orchestration.DeleteCollection(collectionName); } }
public void CreateCollectionWithItemAsObjectAsync() { // Set up const string collectionName = "TestCollection01"; var orchestration = new Orchestrate(TestHelper.ApiKey); var item = new TestData { Id = 1, Value = "CreateCollectionWithItemAsObject" }; try { var result = orchestration.CreateCollectionAsync(collectionName, Guid.NewGuid().ToString(), item).Result; Assert.IsTrue(result.Path.Ref.Length > 0); } catch (Exception ex) { Assert.Fail(ex.Message); } finally { orchestration.DeleteCollection(collectionName); } }
public void DeleteCollectionNoName() { // Set up const string collectionName = "TestCollection04"; var orchestration = new Orchestrate(ApiKey); var item = new TestData { Id = 1, Value = "DeleteCollection" }; var json = JsonConvert.SerializeObject(item); try { orchestration.CreateCollection(collectionName, Guid.NewGuid().ToString(), json); orchestration.DeleteCollection(string.Empty); } catch (ArgumentNullException ex) { Assert.IsTrue(ex.ParamName == "collectionName"); orchestration.DeleteCollection(collectionName); return; } Assert.Fail("No Exception Thrown"); }
public void TestInitialize() { _orchestrate = new Orchestrate(ApiKey); }
public static void ClassCleanUp() { var orchestrate = new Orchestrate(ApiKey); orchestrate.DeleteCollection(CollectionName); }
public void TestInitialize() { _orchestrate = new Orchestrate(TestHelper.ApiKey); }
public void CreateCollectionNoCollectionName() { // Set up const string collectionName = ""; var orchestration = new Orchestrate(TestHelper.ApiKey); var item = new TestData {Id = 1, Value = "CreateCollectionNoCollectionName"}; try { orchestration.Put(collectionName, Guid.NewGuid().ToString(), item); } catch (ArgumentNullException ex) { Assert.IsTrue(ex.ParamName == "collectionName"); return; } Assert.Fail("No Exception Thrown"); }
public void CreateCollectionNoCollectionNameAsync() { // Set up const string collectionName = ""; var orchestration = new Orchestrate(TestHelper.ApiKey); var item = new TestData {Id = 1, Value = "CreateCollectionNoCollectionName"}; try { var result = orchestration.PutAsync(collectionName, Guid.NewGuid().ToString(), item).Result; } catch (AggregateException ex) { var inner = ex.InnerExceptions.First() as ArgumentNullException; Assert.IsTrue(inner?.ParamName == "collectionName"); return; } Assert.Fail("No Exception Thrown"); }
public void CreateCollectionNoKey() { // Set up const string collectionName = "TestCollection04"; var orchestration = new Orchestrate(TestHelper.ApiKey); var item = new TestData {Id = 1, Value = "CreateCollectionNoCollectionName"}; try { orchestration.Put(collectionName, string.Empty, item); } catch (ArgumentNullException ex) { Assert.IsTrue(ex.ParamName == "key"); return; } orchestration.DeleteCollection(collectionName); Assert.Fail("No Exception Thrown"); }
public void CreateCollectionNoKeyAsync() { // Set up const string collectionName = "TestCollection04"; var orchestration = new Orchestrate(TestHelper.ApiKey); var item = new TestData {Id = 1, Value = "CreateCollectionNoCollectionName"}; try { var result = orchestration.PutAsync(collectionName, string.Empty, item).Result; } catch (AggregateException ex) { var inner = ex.InnerExceptions.First() as ArgumentNullException; Assert.IsTrue(inner?.ParamName == "key"); return; } orchestration.DeleteCollection(collectionName); Assert.Fail("No Exception Thrown"); }
public void CreateCollectionNoItem() { // Set up const string collectionName = "TestCollection05"; var orchestration = new Orchestrate(TestHelper.ApiKey); try { orchestration.Put(collectionName, Guid.NewGuid().ToString(), (object) null); } catch (ArgumentNullException ex) { Assert.IsTrue(ex.ParamName == "item"); return; } orchestration.DeleteCollection(collectionName); Assert.Fail("No Exception Thrown"); }
public void CreateCollectionNoItemAsync() { // Set up const string collectionName = "TestCollection05"; var orchestration = new Orchestrate(TestHelper.ApiKey); try { var result = orchestration.PutAsync(collectionName, Guid.NewGuid().ToString(), (object) null).Result; } catch (AggregateException ex) { var inner = ex.InnerExceptions.First() as ArgumentNullException; Assert.IsTrue(inner?.ParamName == "item"); return; } orchestration.DeleteCollection(collectionName); Assert.Fail("No Exception Thrown"); }
public void DeleteNonExistantCollectionAsync() { // Set up var orchestration = new Orchestrate(TestHelper.ApiKey); try { var result = orchestration.DeleteCollectionAsync("NonExistantCollection").Result; Assert.IsTrue(result.Path.Collection.Length > 0); } catch (Exception ex) { Assert.Fail(ex.Message); } }
public void DeleteCollectionNoName() { // Set up const string collectionName = "TestCollection04"; var orchestration = new Orchestrate(TestHelper.ApiKey); var item = new TestData {Id = 1, Value = "DeleteCollection"}; var json = JsonConvert.SerializeObject(item); try { orchestration.Put(collectionName, Guid.NewGuid().ToString(), json); orchestration.DeleteCollection(string.Empty); } catch (ArgumentNullException ex) { Assert.IsTrue(ex.ParamName == "collectionName"); orchestration.DeleteCollection(collectionName); return; } Assert.Fail("No Exception Thrown"); }
public void DeleteCollectionNoNameAsync() { // Set up const string collectionName = "TestCollection04"; var orchestration = new Orchestrate(TestHelper.ApiKey); var item = new TestData {Id = 1, Value = "DeleteCollection"}; var json = JsonConvert.SerializeObject(item); try { var result = orchestration.PutAsync(collectionName, Guid.NewGuid().ToString(), json).Result; var deleteResult = orchestration.DeleteCollectionAsync(string.Empty).Result; } catch (AggregateException ex) { var inner = ex.InnerExceptions.First() as ArgumentNullException; Assert.IsTrue(inner?.ParamName == "collectionName"); orchestration.DeleteCollection(collectionName); return; } Assert.Fail("No Exception Thrown"); }
public ValuesController(IOptions <Orchestrate> settings) { settings_orchestrate = settings.Value; }