public void ShouldThrowArgumentNullExceptionWithCorrectMessage_WhenIWhenItsDoneDbContextParameterIsNull() { IWhenItsDoneDbContext invalidDbContext = null; Assert.That( () => new GenericAsyncRepository <IDbModel>(invalidDbContext), Throws.InstanceOf <ArgumentNullException>().With.Message.Contains("DbContext")); }
public void ThrowArgumentNullException_WhenDbContextParameterIsNull() { IWhenItsDoneDbContext invalidDbContextParameter = null; Assert.That( () => new UnitOfWork(invalidDbContextParameter), Throws.InstanceOf <ArgumentNullException>().With.Message.Contains("DbContext")); }
public UnitOfWork(IWhenItsDoneDbContext dbContext) { if (dbContext == null) { throw new ArgumentNullException("DbContext"); } this.dbContext = dbContext; }
public GenericAsyncRepository(IWhenItsDoneDbContext dbContext) { if (dbContext == null) { throw new ArgumentNullException("DbContext"); } this.dbContext = dbContext; this.dbSet = dbContext.Set <TEntity>(); if (this.dbSet == null) { throw new ArgumentException("DbContext does not contain DbSet<{0}>", typeof(TEntity).Name); } }
public ProfilePicturesAsyncRepository(IWhenItsDoneDbContext dbContext) : base(dbContext) { }
public DishesAsyncRepository(IWhenItsDoneDbContext dbContext) : base(dbContext) { }
public WorkerAsyncRepository(IWhenItsDoneDbContext dbContext) : base(dbContext) { }