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 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 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 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 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 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 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(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 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 DeleteNonExistantCollection() { // Set up var orchestration = new Orchestrate(TestHelper.ApiKey); try { var result = orchestration.DeleteCollection("NonExistantCollection"); Assert.IsTrue(result.Path.Collection.Length > 0); } catch (Exception ex) { Assert.Fail(ex.Message); } }
public static void ClassCleanUp() { var orchestrate = new Orchestrate(ApiKey); orchestrate.DeleteCollection(CollectionName); }
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"); }