public void WhenGettingFillupsAndRepositoryThrows_ThenWrapsException() { _fillupRepositoryMock .Setup(f => f.GetFillups(DefaultVehicleId)) .Throws<InvalidOperationException>(); var handler = new GetFillupsForVehicle(_fillupRepositoryMock.Object); var ex = Assert.Throws<BusinessServicesException>(() => handler.Execute(DefaultVehicleId)); Assert.IsType<InvalidOperationException>(ex.InnerException); }
public GetFillUpsController(GetFillupsForVehicle getFillupsForVehicle) { this.getFillupsForVehicle = getFillupsForVehicle; }