From eef7a23c8f1e3cea8dbfe0d485b0a07de2659d6f Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Thu, 30 Aug 2018 10:17:31 +0200 Subject: [PATCH] Regroup Instantiation tests --- test/src/grid_test.dart | 72 ++++++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 34 deletions(-) diff --git a/test/src/grid_test.dart b/test/src/grid_test.dart index 07dd467..d6eae8f 100644 --- a/test/src/grid_test.dart +++ b/test/src/grid_test.dart @@ -30,45 +30,49 @@ void main() { Grid sut = Grid(87, 85); expect(sut.length, 7395); }, tags: const ["happy"]); - test("copies the content of another grid on .from Constructor call", () { - Grid original = Grid(2, 2); - original[0] = "Hey"; - original[1] = "you"; - original[2] = "me"; - original[3] = "together"; + group(".from", () { + test("copies the content of another grid on .from Constructor call", () { + Grid original = Grid(2, 2); + original[0] = "Hey"; + original[1] = "you"; + original[2] = "me"; + original[3] = "together"; - Grid sut = Grid.from(original); - expect(sut, containsAllInOrder(["Hey", "you", "me", "together"])); - }, tags: const ["happy"]); - test("copies the length of another grid on .from Constructor call", () { - Grid original = Grid(2, 2); - original[0] = "Hey"; - original[1] = "you"; - original[2] = "me"; - original[3] = "together"; + Grid sut = Grid.from(original); + expect(sut, containsAllInOrder(["Hey", "you", "me", "together"])); + }, tags: const ["happy"]); + test("copies the length of another grid on .from Constructor call", () { + Grid original = Grid(2, 2); + original[0] = "Hey"; + original[1] = "you"; + original[2] = "me"; + original[3] = "together"; - Grid sut = Grid.from(original); - expect(sut.length, 4); - }, tags: const ["happy"]); - test("sets the length for list passed in on .fromList Constructor call", - () { - Grid sut = Grid.fromList(l, 3); + Grid sut = Grid.from(original); + expect(sut.length, 4); + }, tags: const ["happy"]); + }); + group(".fromList", () { + test("sets the length for list passed in on .fromList Constructor call", + () { + Grid sut = Grid.fromList(l, 3); - expect(sut.length, 9); - }, tags: const ["happy"]); - test("sets the contents of list passed in on .fromList Constructor call", - () { - Grid sut = Grid.fromList(l, 3); + expect(sut.length, 9); + }, tags: const ["happy"]); + test("sets the contents of list passed in on .fromList Constructor call", + () { + Grid sut = Grid.fromList(l, 3); - expect(sut[3], "together"); - }, tags: const ["happy"]); - test( - "sets the correct height for list passed in on .fromList Constructor call", - () { - Grid sut = Grid.fromList(l, 3); + expect(sut[3], "together"); + }, tags: const ["happy"]); + test( + "sets the correct height for list passed in on .fromList Constructor call", + () { + Grid sut = Grid.fromList(l, 3); - expect(sut.width, 3); - }, tags: const ["happy"]); + expect(sut.width, 3); + }, tags: const ["happy"]); + }); }); group("toIndex", () { Grid sut;