Example #1
0
        public static async Task ApplyLocationAsync(
            IGoogleMapsConnector googleMaps, Address address)
        {
            var location = await googleMaps.GetLocationAsync(address);

            address.SetLocation(location);
        }
        public ChangeAddressTest()
        {
            _mapper = MapperHelper.GetMapper();

            _addressRepository = Substitute.For <IAddressRepository>();

            _driverRepository = Substitute.For <IDriverRepository>();

            _logger = LoggerHelper.GetLogger <ChangeAddressHandler>();

            _googleMaps = Substitute.For <IGoogleMapsConnector>();

            _googleMaps.GetLocationAsync(Arg.Any <IAddress>())
            .Returns(new Location(-10000, -10000));

            _handler = new ChangeAddressHandler(
                _mapper,
                _addressRepository,
                _driverRepository,
                _logger,
                _googleMaps);
        }