Exemplo n.º 1
0
        public void IndexOf_WhenRowNotExists_ShouldReturnMinus1(double[] rowsToTest)
        {
            var matrix     = new Matrix <double>(20, 5);
            var collection = new RowCollection <double>(matrix);

            Assert.Equal(-1, collection.IndexOf(rowsToTest));
        }
Exemplo n.º 2
0
        public void Insert_WhenArgumentIsValid_ShouldAddNewRow()
        {
            var matrix     = new Matrix <int>(2, 2);
            var collection = new RowCollection <int>(matrix);

            collection.Insert(0, new int[] { 1, 1 });
            Assert.Equal(3, collection.Count);
            Assert.Equal(3, collection.LongCount);
            Assert.Equal(0, collection.IndexOf(new int[] { 1, 1 }));
        }
Exemplo n.º 3
0
        public void IndexOf_WhenRowExists_ShouldReturnFirstIndex(int expectedValue, int[] rowToTest)
        {
            var matrix = new Matrix <int>(new int[][]
            {
                new int[] { 1, 2, 3, 4 },
                new int[] { 10, 9, 8, 7 }
            });

            var collection = new RowCollection <int>(matrix);

            Assert.Equal(expectedValue, collection.IndexOf(rowToTest));
        }