Пример #1
0
        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");
        }
Пример #2
0
        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);
            }
        }
Пример #3
0
        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 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 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 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.Put(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);
            }
        }