public async Task MaintainOrderofSavedRelations() { var obj1 = new CB.CloudObject("Hostel"); obj1.Set("room", 123); obj1 = await obj1.SaveAsync(); int room = obj1.Get <int>("room"); if (room == 123) { obj1.Unset("room"); obj1 = await obj1.SaveAsync(); if (obj1.Get("room") == null) { Assert.IsTrue(true); } else { Assert.IsFalse(true); } } else { Assert.IsFalse(true); } }
public async Task UnsetField() { var obj1 = new CB.CloudObject("Hostel"); obj1.Set("room", 123); obj1 = await obj1.SaveAsync(); string room = obj1.Get("room").ToString(); if (room == "123") { obj1.Unset("room"); obj1 = await obj1.SaveAsync(); if (obj1.Get("room") == null) { Assert.IsTrue(true); } else { Assert.IsTrue(false); } } else { Assert.IsTrue(false); } }
public async Task unsetField() { CB.Test.Util.Keys.InitWithClientKey(); var obj1 = new CB.CloudObject("hostel"); obj1.Set("room", 123); obj1 = await obj1.SaveAsync(); string room = obj1.Get("room").ToString(); if (room == "123") { obj1.Unset("room"); await obj1.SaveAsync(); Assert.IsTrue(true); } Assert.IsFalse(true); }