Exemple #1
0
 public void MileageMustNotBeNegative()
 {
     Assert.Catch(() =>
     {
         var newBike = new Sportbike("M", "M", -9, 10);
     });
 }
Exemple #2
0
 public void ModelMustNotBeEmpty()
 {
     Assert.Catch(() =>
     {
         var newBike = new Sportbike("Manufacturer", "", 9, 9);
     });
 }
Exemple #3
0
        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);
        }
Exemple #4
0
 public void BikeMileageCannotBeDecreased()
 {
     var newBike = new Sportbike("Manufacturer", "Model", 10000, 9);
    
     Assert.Catch(() =>
     {
         newBike.SetMileage(5000);
     });
 }
Exemple #5
0
 public void GetNextServiceReturnsCorrectValue()
 {
     var newBike = new Sportbike("Manufacturer", "Model", 10000, 100);
     newBike.ServiceInterval = 3000;
     Assert.IsTrue(newBike.GetNextService() == 2000);
 }
Exemple #6
0
 public void BikeMileageCanBeIncreased()
 {
     var newBike = new Sportbike("Manufacturer", "Model", 10000, 10);
     newBike.SetMileage(15000);
     Assert.IsTrue(newBike.GetMileage() == 15000);
 }