public void GetLocationShouldPulNo() { var options = new DbContextOptionsBuilder <ZipDbContext>() .UseInMemoryDatabase(databaseName: "my_db") .Options; string zip = "90403"; string name = "LA"; string alt = "54321"; // Run the test against one instance of the context using (var context = new ZipDbContext(options)) { context.Cbsas.Add(new CbsaEntity { Zip = zip, Cbsa = "12345" }); context.Msas.Add(new MsaEntity { Cbsa = alt, Mdiv = "12345", Lsad = "Metropolitan Statistical Area", PopEstimate2014 = "100", PopEstimate2015 = "200", Name = name }); context.SaveChanges(); LocationService service = new LocationService(context); List <Location> locationData = service.GetLocationData(zip); Assert.True(locationData.Any(x => x.Cbsa == alt)); } }
public GetAllUsersQueryHandler(ZipDbContext zipDbContext, IMapper mapper) { _zipDbContext = zipDbContext; _mapper = mapper; }
public UsersController(ZipDbContext context, IMapper mapper) { _context = context; _mapper = mapper; }
public CreateUserCommandHandler(ZipDbContext dbContext, IMapper mapper) { _dbContext = dbContext; _mapper = mapper; }
public GetUserQueryHandler(ZipDbContext dbContext, IMapper mapper) { _dbContext = dbContext; _mapper = mapper; }
public AccountRepository(ZipDbContext context) { Context = context ?? throw new ArgumentNullException(nameof(context)); }
public void Setup() { Context = new ZipDbContext(new DbContextOptionsBuilder().UseInMemoryDatabase("zip.db").Options); }
public DataLoadingService(ZipDbContext context) { _context = context; }
public AccountsController(ZipDbContext context, IMapper mapper) { _context = context; _mapper = mapper; }
public LocationService(ZipDbContext context) { _context = context; }