public void ExecuteEmptyMatrixTest() { var matrix = new Matrix(2, 2); var det = new Determinant(matrix); Assert.Throws <ArgumentException>(() => det.Execute()); }
public void ExecuteVectorTest() { var vector = new Vector(new[] { new Number(1), new Number(-2), new Number(3) }); var det = new Determinant(vector); Assert.Throws <ResultIsNotSupportedException>(() => det.Execute()); }
public void ExecuteIsNotSquareTest() { var matrix = new Matrix(new[] { new Vector(new[] { new Number(1), new Number(-2), new Number(3) }), new Vector(new[] { new Number(4), new Number(0), new Number(6) }) }); var det = new Determinant(matrix); Assert.Throws <ArgumentException>(() => det.Execute()); }
public void ExecuteTest() { var matrix = new Matrix(new[] { new Vector(new[] { new Number(1), new Number(-2), new Number(3) }), new Vector(new[] { new Number(4), new Number(0), new Number(6) }), new Vector(new[] { new Number(-7), new Number(8), new Number(9) }) }); var det = new Determinant(matrix); Assert.Equal(204.0, det.Execute()); }