public void SetTile_Succeeded_WasLogged(int x, int y) { var position = new Vector(x, y); var tile = new Tile(); var extent = Mock.Of <Extent>(e => e.SetTile(position, tile)); var changeSet = new ChangeSet(); var loggedExtent = new LoggedExtent(extent, changeSet); Assert.That(loggedExtent.SetTile(position, tile)); Assert.That(changeSet.Undo(extent), Is.EqualTo(1)); }
public void SetTile_Failed_WasNotLogged(int x, int y) { var position = new Vector(x, y); var tile = new Tile(); var extent = Mock.Of <Extent>(e => !e.SetTile(position, tile)); var changeSet = new ChangeSet(); var loggedExtent = new LoggedExtent(extent, changeSet); Assert.That(!loggedExtent.SetTile(position, tile)); Assert.That(changeSet.Undo(extent), Is.Zero); }