public async Task GetAsync_WhenRepositoryIsNull_ThrowsArgumentNullException <TEntity, TKey>( TKey defaultKey, TEntity entity, Expression <Func <TEntity, bool> > filterExpression) where TEntity : class, IEntity <TKey> { // Arrange & Act & Assert var exception = await Assert.ThrowsAsync <ArgumentNullException>( () => RepositoryExtensions.GetAsync <TEntity, TKey>(null, filterExpression) ); if (entity != null && entity.Id != null) { Assert.IsType(defaultKey.GetType(), entity.Id); } Assert.Equal("repository", exception.ParamName); }