public void Initialize() { _messageBus = Substitute.For <IQueue>(); _cabRideService = Substitute.For <ICabRideService>(); _driveCustomerToTrainStationMapper = Substitute.For <IDriveCustomerToTrainStationMapper>(); _cabRideMapper = Substitute.For <ICabRideMapper>(); _driveCustomerToTrainStationMapper .MapToCustomerId(Arg.Any <DriveCustomerToTrainStation>()) .Returns(_fixture.Create <Id <Customer> >()); _driveCustomerToTrainStationMapper .MapToCustomerLocation(Arg.Any <DriveCustomerToTrainStation>()) .Returns(_fixture.Create <Location>()); _cabRideMapper .MapFailedEvent(Arg.Any <DriveCustomerToTrainStation>(), Arg.Any <Exception>()) .Returns(_fixture.Create <DriveCustomerToTrainStationFailed>()); _cabRideMapper .MapSuccessEvent(Arg.Any <Ride>()) .Returns(_fixture.Create <DroveCustomerToTrainStation>()); _sut = new DriveCustomerToTrainStationHandler(_messageBus, _cabRideService, _driveCustomerToTrainStationMapper, _cabRideMapper); }
public void Initialize() { _messageBus = Substitute.For <IQueue>(); _cabRideService = Substitute.For <ICabRideService>(); _driveCustomerToTrainStationMapper = Substitute.For <IDriveCustomerToTrainStationMapper>(); _cabRideMapper = Substitute.For <ICabRideMapper>(); }
public void Initialize() { _callback = Substitute.For <ICallback>(); _cabRideRepository = Substitute.For <ICabRideRepository>(); _cabRideMapper = Substitute.For <ICabRideMapper>(); _sut = new DroveCustomerToTrainStationHandler(_callback, _cabRideRepository, _cabRideMapper); }
public DroveCustomerToTrainStationHandler(ICallback callback, ICabRideRepository cabRideRepository, ICabRideMapper cabRideMapper) { _callback = callback ?? throw new ArgumentNullException(nameof(callback)); _cabRideRepository = cabRideRepository ?? throw new ArgumentNullException(nameof(cabRideRepository)); _cabRideMapper = cabRideMapper ?? throw new ArgumentNullException(nameof(cabRideMapper)); }
public DriveCustomerToTrainStationHandler(IQueue messageBus, ICabRideService cabRideService, IDriveCustomerToTrainStationMapper driveCustomerToTrainStationMapper, ICabRideMapper cabRideMapper) { _messageBus = messageBus ?? throw new ArgumentNullException(nameof(messageBus)); _cabRideService = cabRideService ?? throw new ArgumentNullException(nameof(cabRideService)); _driveCustomerToTrainStationMapper = driveCustomerToTrainStationMapper ?? throw new ArgumentNullException(nameof(driveCustomerToTrainStationMapper)); _cabRideMapper = cabRideMapper ?? throw new ArgumentNullException(nameof(cabRideMapper)); }
public void WhenNoCabRideMapper_ShouldThrowArgumentNullException() { // Arrange ICabRideMapper cabRideMapper = null; // Act Action act = () => new DriveCustomerToTrainStationHandler(_messageBus, _cabRideService, _driveCustomerToTrainStationMapper, cabRideMapper); // Assert act.Should().Throw <ArgumentNullException>(); }
public void WhenNoCabRideMapper_ShouldThrowArgumentNullException() { // Arrange ICabRideMapper cabRideMapper = null; // Act Action act = () => new DroveCustomerToTrainStationHandler(_callback, _cabRideRepository, cabRideMapper); // Assert act.Should().Throw <ArgumentNullException>(); }
public void Initialize() { _callback = Substitute.For <ICallback>(); _cabRideRepository = Substitute.For <ICabRideRepository>(); _cabRideMapper = Substitute.For <ICabRideMapper>(); }