private static void SetRow_InvalidRow_ThrowsException(int y) { ConvolveMatrix matrix = new ConvolveMatrix(1); ExceptionAssert.ThrowsArgumentOutOfRangeException("y", () => { matrix.SetRow(y, 1.0, 2.0); }); }
public void SetRow_InvalidNumberOfValues_ThrowsException() { ConvolveMatrix matrix = new ConvolveMatrix(1); ExceptionAssert.ThrowsArgumentException("values", () => { matrix.SetRow(0, 1, 2, 3); }); }
public void SetRowValuesIsNull_ThrowsException() { ConvolveMatrix matrix = new ConvolveMatrix(1); ExceptionAssert.ThrowsArgumentNullException("values", () => { matrix.SetRow(0, null); }); }
public void SetRow_CorrectNumberOfValues_SetsColumn() { ConvolveMatrix matrix = new ConvolveMatrix(3); matrix.SetRow(1, 6, 8, 10); Assert.AreEqual(0, matrix.GetValue(0, 0)); Assert.AreEqual(6, matrix.GetValue(0, 1)); Assert.AreEqual(0, matrix.GetValue(0, 2)); Assert.AreEqual(0, matrix.GetValue(1, 0)); Assert.AreEqual(8, matrix.GetValue(1, 1)); Assert.AreEqual(0, matrix.GetValue(1, 2)); Assert.AreEqual(0, matrix.GetValue(2, 0)); Assert.AreEqual(10, matrix.GetValue(2, 1)); Assert.AreEqual(0, matrix.GetValue(2, 2)); }