public FavouriteDbFixture() { var builder = new ConfigurationBuilder().AddJsonFile("appsettings.json"); configuration = builder.Build(); context = new FavouriteDBContext(configuration); context.Favourites.DeleteMany(Builders <Favourite> .Filter.Empty); context.Favourites.InsertMany(new List <Favourite> { new Favourite { FavouriteId = 1, UserName = "******", SourceName = "News1", Author = "Xyz", title = "Covid", PublishedAt = DateTime.Now } }); }
public void Dispose() { context = null; }
public FavouriteRepository(FavouriteDBContext _dbContext) { dbContext = _dbContext; }