public void CorrectMessageShownWhenToStringIsCalled(int cap, int speed, string airline, string expected) { Airplane a = new Airplane(cap, speed, airline); a.NumPassengers = 150; a.Ascend(100); a.Move(); Assert.AreEqual(expected, a.ToString()); }
public void CorrectAirplaneDetailsWritten() { Airplane airplane = new Airplane(200, "KLM", 700, 200) { NumPassengers = 200 }; airplane.Ascend(2000); var result = airplane.Move(); Assert.AreEqual("Thank you for flying KLM: SafariPark.Airplane Capacity: 200 Passengers: 200 Speed: 200 Position: 200 Altitude: 2000", airplane.ToString()); }