public void TheLocationValue_ResetsAtBoundary() { var locationService = new LocationService(); var oneOverBoundary = locationService.AdvanceBy(Location.Start, 12); Assert.That(Location.Start, Is.EqualTo(oneOverBoundary)); }
public void GivenValidOffset_WhenAdvancing_FinalPosition_IsSumModuloTwelve(int initialPosition, int offset) { var locationService = new LocationService(); var initialLocation = new Location(initialPosition); var finalPosition = locationService.AdvanceBy(initialLocation, offset); Assert.That(finalPosition, Is.EqualTo(new Location((initialPosition + offset) % 12))); }
public void NegativeValues_AreForbidden_WhenAdvancing(int invalidOffset) { var locationService = new LocationService(); Assert.Throws <ArgumentException>( () => { var x = locationService.AdvanceBy(Location.Start, invalidOffset); }); }