From e40dddde528ebea8ef677fc8cf62751df5f55023 Mon Sep 17 00:00:00 2001 From: Unknown Date: Tue, 23 Oct 2018 21:01:27 +0200 Subject: [PATCH] Shorten toggleCell Function Name --- lib/src/Simulation.dart | 2 +- test/simulation_test.dart | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/src/Simulation.dart b/lib/src/Simulation.dart index f3efd39..dfcf2bd 100644 --- a/lib/src/Simulation.dart +++ b/lib/src/Simulation.dart @@ -72,7 +72,7 @@ class Simulation { return math.Point(cx.toInt(), cy.toInt()); } - void toggleCellState(int x, int y) { + void toggleCell(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 e2c6610..4c87191 100644 --- a/test/simulation_test.dart +++ b/test/simulation_test.dart @@ -52,16 +52,16 @@ void main() { }, tags: "nobrowser"); group("toggleCellState", () { test("throws RangeError if outside the map bounds", () { - expect(() => sut.toggleCellState(10, 9), throwsRangeError); + expect(() => sut.toggleCell(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); + sut.toggleCell(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); + sut.toggleCell(1, 1); expect(sut.map.get(1, 1), true); }, tags: const ["nobrowser"]); });