public void RegularObjectWithDefaultConstructorIsCopied() { JustNumbersDefault n = new JustNumbersDefault(); n.TheA = 3; n.TheB = 4.0f; JustNumbersDefault c = (JustNumbersDefault)n.Copy(new JustNumbersDefault()); Assert.AreNotSame(n, c); Assert.AreEqual(n.TheA, c.TheA); Assert.AreEqual(n.TheB, c.TheB); }
public void TestCloneRegularObjectWithDefaultConstructor() { JustNumbersDefault n = new JustNumbersDefault(); n.TheA = 3; n.TheB = 4.0f; JustNumbersDefault c = (JustNumbersDefault)n.Copy(new JustNumbersDefault()); Assert.AreNotSame(n, c); Assert.AreEqual(n.TheA, c.TheA); Assert.AreEqual(n.TheB, c.TheB); }