public void Test_Car_VehicleType() { var vehicle = new ClassLibrary.Car(); string VehicleType = vehicle.VehicleType(); Assert.AreEqual("Car", VehicleType); }
public void Test_PriceMethod240kr() { // Arrange - Creating the object we will use for test var car = new ClassLibrary.Car(); // Act - call the method at object we will be testing double price = car.Price(); // Assert - test the value if is correct (Assert class is static) Assert.AreEqual(240, price); }
public void Test_licensePlate() { Vehicle vehicle = new ClassLibrary.Car(); try { vehicle.LicensePlate("12345678"); } catch (System.ArgumentException) { Assert.Fail(); } }