diff --git a/lib/src/Simulation.dart b/lib/src/Simulation.dart index 1c9461d..f3efd39 100644 --- a/lib/src/Simulation.dart +++ b/lib/src/Simulation.dart @@ -72,10 +72,6 @@ class Simulation { return math.Point(cx.toInt(), cy.toInt()); } - bool getCell(int x, int y) => map.get(x, y); - - void setCell(int x, int y, bool value) => map.set(x, y, value); - void toggleCellState(int x, int y) { map.set(x, y, !map.get(x, y)); } diff --git a/test/simulation_test.dart b/test/simulation_test.dart index 66a027b..e2c6610 100644 --- a/test/simulation_test.dart +++ b/test/simulation_test.dart @@ -7,8 +7,6 @@ import 'package:test/test.dart'; class MockGrid extends Mock implements Grid {} -// TODO: reinstate when decoupling rendering from Simulation @Tags(const ["nobrowser"]) - void main() { Simulation sut; setUp(() { @@ -27,7 +25,7 @@ void main() { var oldMap = sut.map; sut.gridSize = Point(10, 10); expect(sut.map, isNot(same(oldMap))); - }); + }, tags: "nobrowser"); }); group("resetMap", () { test("sets the internal map filled with 'false' ", () { @@ -40,7 +38,7 @@ void main() { sut.clearMap(); expect(sut.dirty, true); }); - }); + }, tags: "nobrowser"); group("save&load", () { test( "saves a copy of the map which does not change when the actual map changes", @@ -51,38 +49,20 @@ void main() { expect(sut.loadSnapshot(), isNot(equals(snapshot))); }); - }); - group("getCellState", () { - test("throws RangeError if outside map bounds", () { - expect(() => sut.getCell(9, 10), throwsRangeError); - }); - test("returns cell value", () { - sut.map.set(1, 1, true); - expect(sut.getCell(1, 1), true); - }); - }); - group("setCellState", () { - test("throws RangeError if outside map bounds", () { - expect(() => sut.setCell(9, 10, true), throwsRangeError); - }); - test("sets cell value", () { - sut.setCell(1, 1, true); - expect(sut.getCell(1, 1), true); - }); - }); + }, tags: "nobrowser"); group("toggleCellState", () { test("throws RangeError if outside the map bounds", () { expect(() => sut.toggleCellState(10, 9), throwsRangeError); - }); + }, tags: const ["nobrowser"]); test("sets the cell to false if currently true", () { sut.map.set(1, 1, true); sut.toggleCellState(1, 1); expect(sut.map.get(1, 1), false); - }); + }, tags: const ["nobrowser"]); test("sets the cell to true if currently false", () { sut.map.set(1, 1, false); sut.toggleCellState(1, 1); expect(sut.map.get(1, 1), true); - }); + }, tags: const ["nobrowser"]); }); }