예제 #1
0
        private static void SetRow_InvalidRow_ThrowsException(int y)
        {
            ConvolveMatrix matrix = new ConvolveMatrix(1);

            ExceptionAssert.ThrowsArgumentOutOfRangeException("y", () =>
            {
                matrix.SetRow(y, 1.0, 2.0);
            });
        }
예제 #2
0
        public void SetRow_InvalidNumberOfValues_ThrowsException()
        {
            ConvolveMatrix matrix = new ConvolveMatrix(1);

            ExceptionAssert.ThrowsArgumentException("values", () =>
            {
                matrix.SetRow(0, 1, 2, 3);
            });
        }
예제 #3
0
        public void SetRowValuesIsNull_ThrowsException()
        {
            ConvolveMatrix matrix = new ConvolveMatrix(1);

            ExceptionAssert.ThrowsArgumentNullException("values", () =>
            {
                matrix.SetRow(0, null);
            });
        }
예제 #4
0
        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));
        }