Exemplo n.º 1
0
        private static void SetColumn_InvalidColumn_ThrowsException(int x)
        {
            ConvolveMatrix matrix = new ConvolveMatrix(1);

            ExceptionAssert.ThrowsArgumentOutOfRangeException("x", () =>
            {
                matrix.SetColumn(x, 1.0, 2.0);
            });
        }
Exemplo n.º 2
0
        public void SetColumn_InvalidNumberOfValues_ThrowsException()
        {
            ConvolveMatrix matrix = new ConvolveMatrix(1);

            ExceptionAssert.ThrowsArgumentException("values", () =>
            {
                matrix.SetColumn(0, 1, 2, 3);
            });
        }
Exemplo n.º 3
0
        public void SetColumn_ValuesIsNull_ThrowsException()
        {
            ConvolveMatrix matrix = new ConvolveMatrix(1);

            ExceptionAssert.ThrowsArgumentNullException("values", () =>
            {
                matrix.SetColumn(0, null);
            });
        }
Exemplo n.º 4
0
        public void SetColumn_CorrectNumberOfValues_SetsColumn()
        {
            ConvolveMatrix matrix = new ConvolveMatrix(3);

            matrix.SetColumn(1, 6, 8, 10);
            Assert.AreEqual(0, matrix.GetValue(0, 0));
            Assert.AreEqual(0, matrix.GetValue(0, 1));
            Assert.AreEqual(0, matrix.GetValue(0, 2));
            Assert.AreEqual(6, matrix.GetValue(1, 0));
            Assert.AreEqual(8, matrix.GetValue(1, 1));
            Assert.AreEqual(10, matrix.GetValue(1, 2));
            Assert.AreEqual(0, matrix.GetValue(2, 0));
            Assert.AreEqual(0, matrix.GetValue(2, 1));
            Assert.AreEqual(0, matrix.GetValue(2, 2));
        }