public void Clone() { Polynom polynom1 = new Polynom(coeffPolynom1); Polynom polynom2 = (Polynom) polynom1.Clone(); Assert.That(polynom1.Equals(polynom2), Is.True); Assert.That(ReferenceEquals(polynom1, polynom2), Is.False); }
public void Clone_Test() { var expected = new Polynom(3, 5, 7); var actual = expected.Clone(); Assert.AreEqual(expected, actual); Assert.IsFalse(ReferenceEquals(actual, expected)); Assert.IsFalse(ReferenceEquals(expected.Coefficients, actual.Coefficients)); CollectionAssert.AreEqual(expected.Coefficients, actual.Coefficients); }
public void Clone_OnePolynomialData_CloneIsDoneSuccessful() { var polyCloneOfFirst = (Polynom)polyFirst.Clone(); Assert.AreEqual(polyFirst, polyCloneOfFirst); }
public void Test_Clone() { double[] coefficients = new double[] { 1, 2, 3, 4, 5 }; Polynom a = new Polynom(coefficients); Polynom b = (Polynom)a.Clone(); Assert.IsTrue(a.Equals(b)); }