Beispiel #1
0
        public void IsMatrixSummetrical_InalidMatrix_ArgumentExeption()
        {
            int[,] array1 = new int[5, 5] {
                { 1, 2, 3, 4, 5 },
                { 1, 2, 3, 4, 5 },
                { 1, 2, 3, 4, 5 },
                { 1, 2, 3, 4, 5 },
                { 1, 2, 3, 4, 5 }
            };
            SymmetricalValidator <int> validator = new SymmetricalValidator <int>();

            Assert.Throws <ArgumentException>(() => new SymmetricalMatrix <int>(array1, validator));
        }
Beispiel #2
0
        public void Indexator_ValideIndexes_ChangedElement()
        {
            int[,] array = new int[5, 5] {
                { 1, 0, 0, 0, 0 },
                { 0, 2, 0, 0, 0 },
                { 0, 0, 3, 0, 0 },
                { 0, 0, 0, 4, 0 },
                { 0, 0, 0, 0, 5 }
            };

            SymmetricalValidator <int> validator = new SymmetricalValidator <int>();
            Matrix <int> matrix = new SymmetricalMatrix <int>(array, validator);

            matrix[1, 1] = 5;

            Assert.AreEqual(5, matrix[1, 1]);
        }