Пример #1
0
    //--------------------------------------------------------------------
    protected void Test_InsertDelete(DataStructures.GenericMatrixDimension <string> MD)
    {
        int ndx = 0;
        int n   = 0;

        // Insert/Delete small in middle
        ndx = (int)(MD.Max - MD.Min) / 2;
        n   = (int)MD.Count / 2;
        MD.Insert(ndx, n);
        MD.Delete(ndx, n);
        AssertEvenMatrix(MD.Matrix);

        // Insert/Delete small in front
        ndx = MD.Min;
        n   = (int)MD.Count / 2;
        MD.Insert(ndx, n);
        MD.Delete(ndx, n);
        AssertEvenMatrix(MD.Matrix);

        // Insert/Delete large in middle
        ndx = (int)(MD.Max - MD.Min) / 2;
        n   = (MD.Count * 2);
        MD.Insert(ndx, n);
        MD.Delete(ndx, n);
        AssertEvenMatrix(MD.Matrix);

        // Insert/Delete large in front
        ndx = MD.Min;
        n   = (MD.Count * 2);
        MD.Insert(ndx, n);
        MD.Delete(ndx, n);
        AssertEvenMatrix(MD.Matrix);

        return;
    }
Пример #2
0
    //--------------------------------------------------------------------
    protected void Test_AppendDelete(DataStructures.GenericMatrixDimension <string> MD)
    {
        int ndx = MD.Max;

        MD.Append(10);
        MD.Delete(ndx + 1, 10);
        AssertEvenMatrix(MD.Matrix);
        return;
    }
Пример #3
0
    //--------------------------------------------------------------------
    protected void Test_InsertMoveDelete(DataStructures.GenericMatrixDimension <string> MD)
    {
        int n = 0;

        n = (int)MD.Count / 3;
        MD.Insert(n + 1, n);
        MD.Move(MD.Min, n + 1, n);
        MD.Move(n + 1, MD.Min, n);
        MD.Delete(n + 1, n);
        AssertEvenMatrix(MD.Matrix);
        return;
    }