Esempio n. 1
0
        public void TestImmutableKeys()
        {
            ParseUser user = new ParseUser();

            string[] immutableKeys = new string[] {
                "sessionToken", "isNew"
            };

            foreach (var key in immutableKeys)
            {
                Assert.Throws <InvalidOperationException>(() =>
                                                          user[key] = "1234567890"
                                                          );

                Assert.Throws <InvalidOperationException>(() =>
                                                          user.Add(key, "1234567890")
                                                          );

                Assert.Throws <InvalidOperationException>(() =>
                                                          user.AddRangeUniqueToList(key, new string[] { "1234567890" })
                                                          );

                Assert.Throws <InvalidOperationException>(() =>
                                                          user.Remove(key)
                                                          );

                Assert.Throws <InvalidOperationException>(() =>
                                                          user.RemoveAllFromList(key, new string[] { "1234567890" })
                                                          );
            }

            // Other special keys should be good
            user["username"] = "******";
            user["password"] = "******";
        }