示例#1
0
        public async Task x005_ShouldUpdateANewColumnInATable()
        {
            var tableName1 = CB.Test.Util.Methods._makeString();
            var tableName2 = CB.Test.Util.Methods._makeString();

            var obj  = new CB.CloudTable(tableName1);
            var obj1 = new CB.CloudTable(tableName2);

            obj = await obj.SaveAsync();

            obj1 = await obj1.SaveAsync();

            obj = await CB.CloudTable.GetAsync(obj);

            var column1 = new CB.Column("Name11", CB.DataType.Relation.ToString(), true, false);

            column1.RelatedTo = tableName2;

            obj.AddColumn(column1);

            obj = await obj.SaveAsync();

            var column2 = new CB.Column("Name11");

            obj.DeleteColumn(column2);
            obj = await obj.SaveAsync();

            Assert.IsTrue(true);
        }
示例#2
0
        public async Task x012_ShouldNotDeleteTheDefaultColumnOfTheTable()
        {
            var tableName = CB.Test.Util.Methods._makeString();

            var obj = new CB.CloudTable(tableName);

            obj = await obj.SaveAsync();

            obj.DeleteColumn(obj.Columns.Single(o => obj.Name == "Id"));

            try
            {
                obj = await obj.SaveAsync();

                Assert.Fail("Cannot delete the default column");
            }
            catch (CB.Exception.CloudBoostException e)
            {
                Console.WriteLine(e);
                Assert.IsTrue(true);
            }
        }