public void TestSerializeReadOnlyWithContinue() { HaveReadOnly o = new HaveReadOnly(); o.Value = "a"; PropertySerializer <HaveReadOnly> ser = new PropertySerializer <HaveReadOnly>("Value", "WriteOnly"); ser.ContinueOnError = true; Assert.AreEqual(true, ser.ContinueOnError); ser.Serialize(o, Dictionary); }
public void TestObjectSerializer() { HaveReadOnly data = new HaveReadOnly(); data.Value = "a"; ObjectSerializer ser = new ObjectSerializer(data, "Value"); ser.Serialize(Dictionary); HaveReadOnly test = new HaveReadOnly(); ser = new ObjectSerializer(test, "Value"); ser.Deserialize(Dictionary); Assert.AreEqual("a", test.Value); }
public void TestDeserializeReadOnly() { HaveReadOnly o = new HaveReadOnly(); o.Value = "a"; PropertySerializer <HaveReadOnly> ser = new PropertySerializer <HaveReadOnly>("Value", "ReadOnly"); ser.ContinueOnError = false; Assert.AreEqual(false, ser.ContinueOnError); ser.Serialize(o, Dictionary); HaveReadOnly test = new HaveReadOnly(); ser.Deserialize(test, Dictionary); //should go boom Assert.Fail(); }
public void TestObjectSerializer() { HaveReadOnly data = new HaveReadOnly(); data.Value = "a"; ObjectSerializer ser = new ObjectSerializer(data, "Value"); ser.Serialize(Dictionary); HaveReadOnly test = new HaveReadOnly(); ser = new ObjectSerializer(test, "Value"); ser.Deserialize(Dictionary); Assert.AreEqual("a", test.Value); }
public void TestSerializeReadOnlyWithContinue() { HaveReadOnly o = new HaveReadOnly(); o.Value = "a"; PropertySerializer<HaveReadOnly> ser = new PropertySerializer<HaveReadOnly>("Value", "WriteOnly"); ser.ContinueOnError = true; Assert.AreEqual(true, ser.ContinueOnError); ser.Serialize(o, Dictionary); }
public void TestDeserializeReadOnly() { HaveReadOnly o = new HaveReadOnly(); o.Value = "a"; PropertySerializer<HaveReadOnly> ser = new PropertySerializer<HaveReadOnly>("Value", "ReadOnly"); ser.ContinueOnError = false; Assert.AreEqual(false, ser.ContinueOnError); ser.Serialize(o, Dictionary); HaveReadOnly test = new HaveReadOnly(); ser.Deserialize(test, Dictionary);//should go boom Assert.Fail(); }