public CoordenadasRepositoryTests() { _config = new ConfigurationBuilder() .SetBasePath(Environment.CurrentDirectory) .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) .Build(); var services = new ServiceCollection() .AddTransient <ICoordenadasRepository, GoogleMapsCoordenadasRepository>( x => new GoogleMapsCoordenadasRepository( _config["GoogleMapsApi:BaseUrl"], _config["GoogleMapsApi:Key"])); var serviceProvider = services.BuildServiceProvider(); _rep = serviceProvider.GetService <ICoordenadasRepository>(); }
public MotoristaService(IMotoristaRepository repMotorista, ICoordenadasRepository repCoordenadas) { _repMotorista = repMotorista; _repCoordenadas = repCoordenadas; }