public void TestMethodCalculateStops() { int distance = 10000000; StarShip ship = new StarShip(); ship.CreateStarShip(12000, "TestShip", 20); int stops = ship.CalculateStops(distance); Assert.IsTrue(41 == ship.CalculateStops(distance)); }
public void StarShipWith3DaysOfConsumables40MGLTAnd1MOfDistanceShouldStop347Times() { StarShip starShip = new StarShip("3 days", "40"); Assert.AreEqual(347, starShip.CalculateStops(1000000)); }
public void StarShipShouldNotStopIfDistanceEqualsZero() { StarShip starShip = new StarShip("1 week", "80"); Assert.AreEqual(0, starShip.CalculateStops(0)); }
public void StarShipWith2YearsOfConsumables40MGLTAnd10MOfDistanceShouldStop14Times() { StarShip starShip = new StarShip("2 years", "40"); Assert.AreEqual(14, starShip.CalculateStops(10000000)); }
public void StarShipWith2MounthsOfConsumables75MGLTAnd1MOfDistanceShouldStop9Times() { StarShip starShip = new StarShip("2 months", "75"); Assert.AreEqual(9, starShip.CalculateStops(1000000)); }
public void StarShipWith1WeekOfConsumables80MGLTAnd1MOfDistanceShouldStop74Times() { StarShip starShip = new StarShip("1 week", "80"); Assert.AreEqual(74, starShip.CalculateStops(1000000)); }
public void StarShipWith1HourOfConsumables1MGLTAnd1OfDistanceShouldNotStop() { StarShip starShip = new StarShip("1 hour", "1"); Assert.AreEqual(0, starShip.CalculateStops(1)); }
public void StarShipWithUnknownMGLTShouldNotDetermineTheStops() { StarShip starShip = new StarShip("3 minutes", "unknown"); Assert.AreEqual(-1, starShip.CalculateStops(1000000)); }
public void StarShipWithMinutesOfConsumableShouldNotDetermineTheStops() { StarShip starShip = new StarShip("3 minutes", "40"); Assert.AreEqual(-1, starShip.CalculateStops(1000000)); }
public void StarShipShouldNotLeaveIfThereAreNoConsumables() { StarShip starShip = new StarShip("0 hour", "80"); Assert.AreEqual(-1, starShip.CalculateStops(100000)); }
public void StarShipShouldNotLeaveIfMGLTEqualsZero() { StarShip starShip = new StarShip("1 week", "0"); Assert.AreEqual(-1, starShip.CalculateStops(100000)); }