Esempio n. 1
0
 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);
 }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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));
        }