public BookCatalogueControllerTest() { var builder = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory()).AddJsonFile("appsettings.json"); _configuration = builder.Build(); _options = new DbContextOptionsBuilder <BookCatalogueContext>().UseSqlServer(_configuration.GetConnectionString("DefaultConnection")).Options; BookCatalogueContext = new BookCatalogueContext(_options); }
public BookCatalogueController(IBookCatalogueContext context) { BookCatalogueContext = context; }