예제 #1
0
        public void TestRemoveFields()
        {
            IObjectState state = new MutableObjectState
            {
                ServerData = new Dictionary <string, object>()
                {
                    { "username", "kevin" },
                    { "name", "andrew" }
                }
            };
            AVUser user = AVObjectExtensions.FromState <AVUser>(state, "_User");

            Assert.Throws <ArgumentException>(() => user.Remove("username"));
            Assert.DoesNotThrow(() => user.Remove("name"));
            Assert.False(user.ContainsKey("name"));
        }