How do I write MS unit test for DbHelper.cs? I am unable to mock. In each DbHelper method there is _dbContext = new AppDbContext(GetAllOptions()) and GetAllOptions is looking for connection string. So overall it doesn't look right for mocking and creating unit test cases. Any example will help.
Hello, this is an excellent articule, but; this module: CreateDbIfNoneExist(host) can not be called because DOES NOT EXISTS in the context, you call it from Main and it is declared out.
Any help?
Somanath Sutar
How do I write MS unit test for DbHelper.cs? I am unable to mock. In each DbHelper method there is _dbContext = new AppDbContext(GetAllOptions()) and GetAllOptions is looking for connection string. So overall it doesn't look right for mocking and creating unit test cases. Any example will help.