public void TestPublicProperty() { Animal animal = new Animal(false) { ScientificName = "Raphus cucullatus" }; Ave dodo = new Ave(true); Assert.IsTrue(string.IsNullOrEmpty(dodo.ScientificName)); dodo.IntialiseFrom(animal); Assert.AreEqual("Raphus cucullatus", dodo.ScientificName); }
public void TestPrivateProperty() { Animal animal = new Animal { ScientificName = "Raphus cucullatus" }; Ave dodo = new Ave(); dodo.SetHiddenProperty(string.Empty); Assert.AreEqual("Secret Value", animal.GetHiddenProperty()); Assert.IsTrue(string.IsNullOrEmpty(dodo.GetHiddenProperty())); dodo.IntialiseFrom(animal); Assert.IsTrue(string.IsNullOrEmpty(dodo.GetHiddenProperty())); }