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