public void MileageMustNotBeNegative() { Assert.Catch(() => { var newBike = new Sportbike("M", "M", -9, 10); }); }
public void ModelMustNotBeEmpty() { Assert.Catch(() => { var newBike = new Sportbike("Manufacturer", "", 9, 9); }); }
public void BikePropertiesSameAfterInitialisation() { var newBike = new Sportbike("Manufacturer", "Model", 123456, 10); Assert.IsTrue(newBike.Manufacturer == "Manufacturer"); Assert.IsTrue(newBike.Model == "Model"); Assert.IsTrue(newBike.GetMileage() == 123456); }
public void BikeMileageCannotBeDecreased() { var newBike = new Sportbike("Manufacturer", "Model", 10000, 9); Assert.Catch(() => { newBike.SetMileage(5000); }); }
public void GetNextServiceReturnsCorrectValue() { var newBike = new Sportbike("Manufacturer", "Model", 10000, 100); newBike.ServiceInterval = 3000; Assert.IsTrue(newBike.GetNextService() == 2000); }
public void BikeMileageCanBeIncreased() { var newBike = new Sportbike("Manufacturer", "Model", 10000, 10); newBike.SetMileage(15000); Assert.IsTrue(newBike.GetMileage() == 15000); }