Is it possible to setup type of in-memory database by Entity Framework? I need this In-Memory database correctly to be as Oracle SQL.
var options = new DbContextOptionsBuilder<MyDbContext>().UseInMemoryDatabase(Guid.NewGuid().ToString()).Options;
MyDbContext context = new(options);
Background: I'm using in-memory database in my unit tests. In real code I'm connecting to Oracle SQL and in one method I check content of string in database by Entity Framework by using function:
predicateBuilder.And(user => EF.Functions.Like(user.Name, "john"))
In my unit tests working method Like as case insensitive but in real code it's working as case sensitive. I found another question and solution for that and I know that this method Like works differently for SQL/SQLite, Oracle/Postgres..
I fixed this issue but for avoiding to have similar issues I'd like to setup in memory database be same type as my real database (for me Oracle SQL)
Dictionary<string,T>. It's meant to mock the database in unit tests, not emulate it. If you want to test case sensitivity use the SQLite provider in in-memory mode. If you want faithful replication of Oracle, use a test version of Oracle. Unit testing doesn't mean you shouldn't use a database when you need to test database behavior