private LandmarkService GetLandmarkService(ILandmarkRepository landmarkRepository = null) { AutoMapperConfiguration.Configure(); landmarkRepository = landmarkRepository ?? new Mock <ILandmarkRepository>().Object; return(new LandmarkService(landmarkRepository)); }
public LandmarkRepositoryTest() { var services = new ServiceCollection(); services.AddDbContext <NYCLandmarkContext>(options => options.UseNpgsql(@"User ID=nyclandmarks;Password=nyclandmarks;Server=192.168.99.100;Port=5432;Database=nyclandmarks;Integrated Security=true;Pooling=true;")); services.AddScoped <ILandmarkRepository, LandmarkRepository>(); serviceProvider = services.BuildServiceProvider(); dbContext = serviceProvider.GetRequiredService <NYCLandmarkContext>(); landmarkRepository = serviceProvider.GetRequiredService <ILandmarkRepository>(); }
public LandmarkRepositoryTest() { var builder = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.json") .Build(); var dbonnection = builder.GetConnectionString("SqlServer"); var serviceProvider = new ServiceCollection() .AddDbContext <NYCLandmarkContext>(options => options.UseSqlServer(dbonnection)) .AddScoped <ILandmarkRepository, LandmarkRepository>() .BuildServiceProvider(); serviceProvider.GetRequiredService <SqlServer.NYCLandmarkContext>(); _dbContext = serviceProvider.GetRequiredService <NYCLandmarkContext>(); _landmarkRepository = serviceProvider.GetRequiredService <ILandmarkRepository>(); }
public LandmarkRepositoryTest(CoreDataStoreDbFixture fixture, ITestOutputHelper output) { _landmarkRepository = fixture.LandmarkRepository; _output = output; }
public LandmarkController(ILandmarkRepository landMarkRepository) { _landMarkRepository = landMarkRepository; }
public UsersController(ILogger <UsersController> logger, ILandmarkRepository landmarkRepository) { _logger = logger; _landmarkRepository = landmarkRepository; }
public LandmarkDataService(ILandmarkRepository landmarkRepository) { _landmarkRepository = landmarkRepository; }
public HomeController(ILandmarkRepository landmarkRepository) { _landmarkRepository = landmarkRepository; }
public LandmarkService(ILandmarkRepository landmarkRepository) { _landmarkRepository = landmarkRepository ?? throw new ArgumentNullException(nameof(landmarkRepository)); }
public LandmarkService(ILandmarkRepository landmarktRepository) { this._landmarktRepository = landmarktRepository; }
public LandmarkService(ILandmarkRepository landmarkRepository, IUnitOfWork unitOfWork) { this._landmarkRepository = landmarkRepository; this._unitOfWork = unitOfWork; }