public void Initialize() { _sut = new CabRideMapper(); _command = _fixture.Create <DriveCustomerToTrainStation>(); _ex = _fixture.Create <Exception>(); }
public Location MapToCustomerLocation(DriveCustomerToTrainStation driveCustomerToTrainStation) { var @long = driveCustomerToTrainStation.CurrentLongitude; var lat = driveCustomerToTrainStation.CurrentLatitude; return(new Location(@long, lat)); }
public async Task WhenNoCommand_ShouldThrowArgumentNullException() { // Arrange DriveCustomerToTrainStation command = null; // Act Func <Task> act = async() => await _sut.Post(command); // Assert act.Should().Throw <ArgumentNullException>(); }
public void WhenNoCommand_ShouldThrowArgumentNullException() { // Arrange DriveCustomerToTrainStation command = null; // Act Action act = () => _sut.MapFailedEvent(command, _ex); // Assert act.Should().Throw <ArgumentNullException>(); }
public DriveCustomerToTrainStationFailed MapFailedEvent(DriveCustomerToTrainStation command, Exception exception) { if (command == null) { throw new ArgumentNullException(nameof(command)); } if (exception == null) { throw new ArgumentNullException(nameof(exception)); } return(new DriveCustomerToTrainStationFailed { Reason = exception.ToString() }); }
public void CreateCustomer() { _command = _fixture.Create <DriveCustomerToTrainStation>(); _command.CurrentLatitude = _customerLocation.Latitude; _command.CurrentLongitude = _customerLocation.Longitude; }
public Id <Customer> MapToCustomerId(DriveCustomerToTrainStation driveCustomerToTrainStation) { return(Id <Customer> .Create(driveCustomerToTrainStation.CustomerId)); }
public Id <Customer> MapToCustomerId(DriveCustomerToTrainStation driveCustomerToTrainStation) { return(new Id <Customer>(driveCustomerToTrainStation.CustomerId)); }