public void Drive_ThrowsInvalidOperationException_WhenHasNoFuel() { Assert.Throws <InvalidOperationException>(() => testCar.Drive(1)); }
public void DriveMethodShouldThrowExceptionWhenNeededFuelIsBiggerThanFuelAmount() { car.Refuel(1); Assert.Throws <InvalidOperationException>(() => car.Drive(100)); }
public void TestDriveMethodShouldThrowAnExeption() { var car = new Car(expectedMake, expectedModel, expectedFuelConsumption, expectedFuelCapacity); Assert.Throws<InvalidOperationException>(() => car.Drive(10000000)); }
public void DriveMethodTestingIfFuelNeededMoreThenAmount_ShouldThrowException(string make, string model, double fuelConsumption, double fuelCapacity) { Car car = new Car(make, model, fuelConsumption, fuelCapacity); Assert.Throws <InvalidOperationException>(() => car.Drive(5)); }
public void CannotDriveIfNotEnoughtFuel() { Car car = new Car("VW", "Golf", 5, 60); Assert.Throws <InvalidOperationException>(() => car.Drive(200)); }
public void DriveThrowsExceptionWhenFuelNeededIsBiggerThanFuelAmount() { var exception = Assert.Throws <InvalidOperationException>(() => car.Drive(100)); Assert.That(exception.Message, Contains.Substring("You don't have enough fuel to drive!")); }
public void DriveThrowsExceptionIfFuelIsNotEnought(double km) { Assert.Throws <InvalidOperationException>(() => car.Drive(km)); }
public void Drive_ThrowException_WhenDataIsInvalid() { double invalidDistance = car.FuelCapacity; Assert.Throws <InvalidOperationException>(() => car.Drive(invalidDistance)); }
public void CarDriveOverDistanceShouldReturnInvalidOperation() { car.Refuel(1); Assert.That(() => car.Drive(100), Throws.InvalidOperationException); }
public void Test_Drive_Works_Correctly(double distance) { car.Refuel(15); car.Drive(distance); Assert.AreEqual(5, car.FuelAmount); }
public void CheckDriveWhenFuelNeededIsMoreThanExpected() { Assert.Throws <InvalidOperationException>(() => car.Drive(150)); }
public void DriveMethodThrowsAnExceptionWhenNotEnoughFuel() { Assert.Throws <InvalidOperationException>(() => car.Drive(100)); }
public void TestIfDriveMethodThrowsExceptionWithInvalidArgument() { Car car = new Car("Audi", "A4", 7, 60); Assert.Throws <InvalidOperationException>(() => car.Drive(20)); }
public void DriveNotEnoughFuelThrowsExc(double fuelToRefuel) { car.Refuel(fuelToRefuel); Assert.Throws <InvalidOperationException>(() => car.Drive(300)); }
public void DriveThrowsExceptionIfTheDistanceIsTooMuch() { //Assert Assert.That(() => car.Drive(5), //Act Throws.InstanceOf <InvalidOperationException>()); }
public void Drive_ThrowsExceptionWhenFuelIsZero() { Assert.Throws <InvalidOperationException>(() => car.Drive(100)); }
public void CheckThatDriveMethodDecreaceFuelAmount(double fuel, double km) { car.Refuel(fuel); car.Drive(km); Assert.That(this.car.FuelAmount, Is.EqualTo(99.5)); }
public void Drive_ThrowsException_WhenTankIsNotFullEnough() { Assert.Throws <InvalidOperationException>(() => car.Drive(200)); }
static void Main(string[] args) { Car car = new Car("BMW", "100km/5 sec", 350, "Black", 70); car.Drive(100); }