public void TestConcatenationNotNullArray() { My_Array a = new My_Array(new int[] { 1, 2, 3 }); int [] conc = a.Concatenation(new int[] { 3, 2, 1 }); CollectionAssert.AreEqual(conc, new int[] { 1, 2, 3, 3, 2, 1 }); }
public void TestConcatenationNullArray() { My_Array a = null; int [] conc = a.Concatenation(new int[] { 1, 2, 3 }); Assert.Fail(); }
public void TestScalarProductNullArray() { My_Array a = null; double scalar = a.ScalarProduct(new int[] { 1, 2, 3 }); Assert.Fail(); }
public void TestScalarProductArrayDifLength() { My_Array a = new My_Array(new int[] { 1, 2, 3 }); double scalar = a.ScalarProduct(new int[] { 1, 2 }); Assert.Fail(); }
public void TestSumArrayDifLength() { My_Array a = new My_Array(new int[] { 1, 2, 3 }); a.Sum(new int[] { 1, 2 }); Assert.Fail(); }
public void TestScalarProductArraySameLength() { My_Array a = new My_Array(new int[] { 1, 2, 3 }); double scalar = a.ScalarProduct(new int[] { 1, 2, 3 }); Assert.AreEqual(scalar, 14); }
public void TestSumArraySameLength() { My_Array a = new My_Array(new int[] { 1, 2, 3 }); a.Sum(new int[] { 1, 2, 3 }); CollectionAssert.AreEqual(a.A, new int[] { 2, 4, 6 }); }
public void TestSumNullArray() { My_Array a = null; a.Sum(new int[] { 1, 2, 3 }); Assert.Fail(); }
public void Array_Sum_123_123_246() { My_Array a = new My_Array(new int[] { 1, 2, 3 }); a.Sum(new int[] { 1, 2, 3 }); CollectionAssert.AreEqual(a.A, new int[] { 2, 4, 6 }); }
public void MyArrayToAnother() { My_Array a = new My_Array(new int[] { 1, 2, 3 }); My_Array b = new My_Array(a); CollectionAssert.AreEqual(a.A, b.A); }
public void Array_Sum_ShorterLength() { My_Array a = new My_Array(new int[] { 1, 2, 3 }); a.Sum(new int[] { 1, 2 }); Assert.Fail(); }
public void CreateFromAnotherArray_FullCopy() { int[] x = new int[] { 1, 2, 3 }; My_Array a = new My_Array(x); My_Array b = new My_Array(a); a.Sum(x); CollectionAssert.AreEqual(a.A, x); Assert.Fail(); }
public void Array_Create_FullCopy() { My_Array array = null; { int [] k = { 1, 2, 3 }; array = new My_Array(k); k[0] = 2; } CollectionAssert.AreEqual(array.A, new int[] { 1, 2, 3 }); }