예제 #1
0
        public async Task TearDown()
        {
            CassandraTable table = await CassandraTableCollection.GetIfExistsAsync(_tableName);

            if (table != null)
            {
                await table.DeleteAsync(WaitUntil.Completed);
            }
        }
예제 #2
0
        public async Task CassandraTableCreateAndUpdate()
        {
            var parameters = BuildCreateUpdateOptions(null);
            var table      = await CreateCassandraTable(parameters);

            Assert.AreEqual(_tableName, table.Data.Resource.Id);
            VerifyCassandraTableCreation(table, parameters);
            // Seems bug in swagger definition
            //Assert.AreEqual(TestThroughput1, table.Data.Options.Throughput);

            bool ifExists = await CassandraTableCollection.ExistsAsync(_tableName);

            Assert.True(ifExists);

            // NOT WORKING API
            //ThroughputSettingsData throughtput = await table.GetCassandraTableThroughputAsync();
            CassandraTable table2 = await CassandraTableCollection.GetAsync(_tableName);

            Assert.AreEqual(_tableName, table2.Data.Resource.Id);
            VerifyCassandraTableCreation(table2, parameters);
            //Assert.AreEqual(TestThroughput1, table2.Data.Options.Throughput);

            VerifyCassandraTables(table, table2);

            parameters.Options = new CreateUpdateOptions {
                Throughput = TestThroughput2
            };

            table = (await CassandraTableCollection.CreateOrUpdateAsync(WaitUntil.Completed, _tableName, parameters)).Value;
            Assert.AreEqual(_tableName, table.Data.Resource.Id);
            VerifyCassandraTableCreation(table, parameters);
            // Seems bug in swagger definition
            table2 = await CassandraTableCollection.GetAsync(_tableName);

            VerifyCassandraTableCreation(table2, parameters);
            // Seems bug in swagger definition
            VerifyCassandraTables(table, table2);
        }