public void ThrowArgumentNullExceptionIfDbContextPassedIsNull() { // Arrange IComicShopDbContext nullContext = null; // Act & Assert Assert.That(() => new EfComicShopDataProvider <IComic>(nullContext), Throws.InstanceOf <ArgumentNullException>()); }
public EfComicShopDataProvider(IComicShopDbContext context) { if (context == null) { throw new ArgumentNullException("An instance of DbContext is required to use this repository.", "context"); } this.Context = context; this.DbSet = this.Context.Set <T>(); }