public void Compute() { ICommand cmd = new TranspondMatrixCmd(matrix); cmd.SetResultCallback((sucess, result) => { this.result = (Matrix)result; }); cmd.Run(); }
public void TranspondMatrixCmdTest() { Matrix matrix = FetchMatrixA(); ICommand cmd = new TranspondMatrixCmd(matrix); cmd.SetResultCallback((sucess, _result) => { Assert.IsTrue(sucess); Matrix result = (Matrix)_result; for (int i = 0; i < matrix.Rows; i++) { for (int j = 0; j < matrix.Columns; j++) { Assert.AreEqual(matrix[i, j], result[j, i], 0.001, "Values computed wrong"); } } }); cmd.Run(); }