public void AddTest_ValidInput_ValidResult_2() { var first = new SqMatrix <int>(Enumerable.Range(2, 16), 4); var second = new SqMatrix <int>(Enumerable.Repeat(5, 16), 4); var expected = new SqMatrix <int>(Enumerable.Range(7, 16), 4); var actual = first.Add(second); Assert.IsTrue(expected.Equals(actual)); }
public void AddTest_ValidInput_ValidResult_1() { var first = new SqMatrix <int>(Enumerable.Range(1, 9), 3); var second = new SqMatrix <int>(Enumerable.Range(1, 9).Reverse(), 3); var expected = new SymmMatrix <int>(Enumerable.Repeat(10, 6), 3); var actual = first.Add(second); Assert.IsTrue(expected.Equals(actual)); }
public void AddTest_WithNullElement() { var first = new SqMatrix <int>(Enumerable.Range(2, 16), 4); Assert.Throws <ArgumentNullException>(() => first.Add(null)); }