public void Builder_Without_Path_Should_Throw_IndexOutOfRangeException() { var model = new Builder(); var pathHistory = new PathHistory(model); Assert.Throws <IndexOutOfRangeException>(() => pathHistory.Last()); }
public void Builder_With_Multiple_Steps_Should_Return_The_Last_One() { var model = new Builder(); var pathHistory = new PathHistory(model); model.Path.Increase(new Pillar(0, 0)); model.Path.Increase(new Pillar(2, 1)); model.Path.Increase(new Pillar(4, 2)); model.Path.Increase(new Pillar(6, 3)); model.Path.Increase(new Pillar(8, 4)); var actual = pathHistory.Last(); Assert.That(actual.X, Is.EqualTo(8), "pillar.X"); Assert.That(actual.Y, Is.EqualTo(4), "pillar.Y"); }