Regroup Instantiation tests

This commit is contained in:
Marty Oehme 2018-08-30 10:17:31 +02:00
parent fb481669ed
commit eef7a23c8f

View file

@ -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;