I have a class with a bunch of overloaded operators:
public static double[,] operator +(Matrix matrix, double[,] array)
public static double[,] operator -(Matrix matrix, double[,] array)
public static double[,] operator *(Matrix matrix, double[,] array)
For all of them I'd like to test operands for null. I have an NUnit
test for that:
public void MatrixOperatorOperandIsNullThrows(Func<Matrix, double[,], double[,]> op)
{
Matrix m = null;
var right = new double[,] {{1, 1}, {1, 1}};
Assert.Throws<ArgumentException>(() => op(m, right));
}
How can I pass a lambda for each operator like (l,r) => l + r
?
TextFixture
? I also use a Resharper to run tests. Can it handle them this way? – Duplicate