Example #1
0
        [Test] public async Task TestUpdateInstanceData()
        {
            Value createdInstance = await client.Query(
                Create(await RandomClass(),
                       Obj("data",
                           Obj(
                               "name", "Magic Missile",
                               "element", "arcane",
                               "cost", 10))));

            Value updatedInstance = await client.Query(
                Update(GetRef(createdInstance),
                       Obj("data",
                           Obj(
                               "name", "Faerie Fire",
                               "cost", Null()))));

            Assert.AreEqual(createdInstance.Get(REF_FIELD), updatedInstance.Get(REF_FIELD));
            Assert.AreEqual("Faerie Fire", updatedInstance.Get(NAME_FIELD));
            Assert.AreEqual("arcane", updatedInstance.Get(ELEMENT_FIELD));
            Assert.AreEqual(None(), updatedInstance.GetOption(COST_FIELD));
        }