示例#1
0
        public void Test_Constructor()
        {
            ExceptionAssert.Throws <ArgumentException>(delegate()
            {
                new ColorMatrix(-1);
            });

            ExceptionAssert.Throws <ArgumentException>(delegate()
            {
                new ColorMatrix(7);
            });

            new ColorMatrix(1);

            ExceptionAssert.Throws <ArgumentException>(delegate()
            {
                new ColorMatrix(2, 1.0);
            });

            ColorMatrix matrix = new ColorMatrix(2, 0.0, 1.0, 0.1, 1.1);

            Assert.AreEqual(0.0, matrix.GetValue(0, 0));
            Assert.AreEqual(1.0, matrix.GetValue(1, 0));
            Assert.AreEqual(0.1, matrix.GetValue(0, 1));
            Assert.AreEqual(1.1, matrix.GetValue(1, 1));
        }
示例#2
0
        public void Test_Value()
        {
            ColorMatrix matrix = new ColorMatrix(2);

            matrix.SetValue(0, 0, 1.5);
            Assert.AreEqual(1.5, matrix.GetValue(0, 0));

            Assert.AreEqual(0.0, matrix.GetValue(0, 1));
            Assert.AreEqual(0.0, matrix.GetValue(1, 0));
        }
示例#3
0
        public void Test_SetRow()
        {
            ColorMatrix matrix = new ColorMatrix(2);

            matrix.SetRow(0, 2, 4);
            Assert.AreEqual(2, matrix.GetValue(0, 0));
            Assert.AreEqual(4, matrix.GetValue(1, 0));

            matrix.SetRow(1, 6, 8);
            Assert.AreEqual(6, matrix.GetValue(0, 1));
            Assert.AreEqual(8, matrix.GetValue(1, 1));
        }