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); }
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); }
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>")); }
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>")); }