public void EmProperty_FromString_GoodString_GetExpected(string goodString, int expectedValue) { var testProp = new TestProperty("TestKey"); testProp.FromString(goodString); Assert.AreEqual(expectedValue, testProp.Value); }
public void EmProperty_ToAndFromString_DataPreserved() { const string key = "TestKey"; var orig = new TestProperty(key, 10); var deserialized = new TestProperty(key); string originalSerialized = orig.ToString(); deserialized.FromString(originalSerialized); string serialized = deserialized.ToString(); Assert.AreEqual(orig.Value, deserialized.Value); Assert.AreEqual(originalSerialized, serialized); }