コード例 #1
0
ファイル: BoxArrayTests.cs プロジェクト: manbou404/CSharpLab
        public void RemoveRowsErrorTestsImpl(IBoxArray<string> box)
        {
            var cols = 2;
            var rows = 1;
            this.InitValue(box, cols, rows);

            var ex = AssertEx.Throws<ArgumentOutOfRangeException>(() => box.RemoveRows(99));
            ex.ParamName.Is("row");

            box.RemoveRows(0);
            box.Width.Is(0);
            box.Height.Is(0);
        }
コード例 #2
0
ファイル: BoxArrayTests.cs プロジェクト: manbou404/CSharpLab
        public void RemoveRowsErrorTestsImpl(IBoxArray <string> box)
        {
            var cols = 2;
            var rows = 1;

            this.InitValue(box, cols, rows);

            var ex = AssertEx.Throws <ArgumentOutOfRangeException>(() => box.RemoveRows(99));

            ex.ParamName.Is("row");

            box.RemoveRows(0);
            box.Width.Is(0);
            box.Height.Is(0);
        }
コード例 #3
0
ファイル: BoxArrayTests.cs プロジェクト: manbou404/CSharpLab
        public void RemoveRowsTestsImpl(IBoxArray <string> box)
        {
            var cols = 2;
            var rows = 4;

            this.InitValue(box, cols, rows);

            box.RemoveRows(1);          // 1行目を削除
            box.Height.Is(3);           // 行が 4 -> 3 に縮んだ
            Loop(cols).ForEach(c => box[c, 0].Is($"{c},0"));
            Loop(cols).ForEach(c => box[c, 1].Is($"{c},2"));
            Loop(cols).ForEach(c => box[c, 2].Is($"{c},3"));

            box.FixedHeight = true;     // 行数を固定
            box.RemoveRows(1, (c, r) => $"<{c},{r}>");
            box.Height.Is(3);           // 列数は変わらない
            Loop(cols).ForEach(c => box[c, 0].Is($"{c},0"));
            Loop(cols).ForEach(c => box[c, 1].Is($"{c},3"));
            Loop(cols).ForEach(c => box[c, 2].Is($"<{c},2>"));
        }
コード例 #4
0
ファイル: BoxArrayTests.cs プロジェクト: manbou404/CSharpLab
        public void RemoveRowsTestsImpl(IBoxArray<string> box)
        {
            var cols = 2;
            var rows = 4;

            this.InitValue(box, cols, rows);

            box.RemoveRows(1);          // 1行目を削除
            box.Height.Is(3);           // 行が 4 -> 3 に縮んだ
            Loop(cols).ForEach(c => box[c, 0].Is($"{c},0"));
            Loop(cols).ForEach(c => box[c, 1].Is($"{c},2"));
            Loop(cols).ForEach(c => box[c, 2].Is($"{c},3"));

            box.FixedHeight = true;     // 行数を固定
            box.RemoveRows(1, (c, r) => $"<{c},{r}>");
            box.Height.Is(3);           // 列数は変わらない
            Loop(cols).ForEach(c => box[c, 0].Is($"{c},0"));
            Loop(cols).ForEach(c => box[c, 1].Is($"{c},3"));
            Loop(cols).ForEach(c => box[c, 2].Is($"<{c},2>"));

        }