IntelliTect / IntelliTect/TestTools

DatabaseFixture<T> does not support generic options

Open
#91 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C#
Stars
10
Forks
4
PR merge metrics
No merged PRs in 30d

Description

Reproduction steps:

Create context with a single constructor that takes in the generic DbContextOptions
```C#
public class BudgetContext : DbContext
{
public BudgetContext(DbContextOptions options)
: base(options)
{ }
}
```

Attempt to use the DatabaseFixture.
```C#
var fixture = new DatabaseFixture();

await fixture.PerformDatabaseOperation(async context =>
{
...
});
```

Observed:
System.InvalidOperationException: '***.BudgetContext' must contain a constructor that has a single parameter of type 'Microsoft.EntityFrameworkCore.DbContextOptions'

Expected:
I want my DbContext to take in the generic options overload.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.