public void TestApplyOperation() {
      IParseFieldOperation op1 = new ParseIncrementOperation(7);
      IParseFieldOperation op2 = new ParseSetOperation("legendia");
      IParseFieldOperation op3 = new ParseSetOperation("vesperia");
      var operations = new Dictionary<string, IParseFieldOperation>() {
        { "exist", op1 },
        { "missing", op2 },
        { "change", op3 }
      };

      IObjectState state = new MutableObjectState {
        ServerData = new Dictionary<string, object>() {
          { "exist", 2 },
          { "change", "teletubies" }
        }
      };

      Assert.AreEqual(2, state["exist"]);
      Assert.AreEqual("teletubies", state["change"]);

      state = state.MutatedClone(mutableClone => {
        mutableClone.Apply(operations);
      });

      Assert.AreEqual(3, state.Count());
      Assert.AreEqual(9, state["exist"]);
      Assert.AreEqual("legendia", state["missing"]);
      Assert.AreEqual("vesperia", state["change"]);
    }
 public void TestEncodeParseFieldOperation() {
   var incOps = new ParseIncrementOperation(1);
   IDictionary<string, object> value = ParseEncoderTestClass.Instance.Encode(incOps) as IDictionary<string, object>;
   Assert.AreEqual("Increment", value["__op"]);
   Assert.AreEqual(1, value["amount"]);
   // Other operations are tested in FieldOperationTests
 }