Make clear map function name more concise

Renam resetting the grid to clearMap.
This commit is contained in:
Unknown 2018-10-21 14:00:01 +02:00
parent 66c273c783
commit e115ed2f48
3 changed files with 10 additions and 10 deletions

View file

@ -1,9 +1,9 @@
import 'dart:math';
import 'package:mockito/mockito.dart';
import 'package:rules_of_living/src/Grid.dart';
import 'package:test/test.dart';
import 'package:rules_of_living/src/Simulation.dart';
import 'package:test/test.dart';
class MockGrid extends Mock implements Grid<bool> {}
@ -25,20 +25,20 @@ 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' ", () {
sut.map.set(1, 1, true);
sut.reset();
sut.clearMap();
expect(sut.map, allOf(TypeMatcher<Grid>(), isNot(contains(true))));
});
test("sets the simulation to need re-rendering", () {
sut.dirty = false;
sut.reset();
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",
@ -49,5 +49,5 @@ void main() {
expect(sut.loadSnapshot(), isNot(equals(snapshot)));
});
});
}, tags: "nobrowser");
}