Allow the Unit Testing/Fake db context to be generated in a separate file
This could be a quirk of my particular environment, but being able to generate the fake db context into a separate would allow us to effectively hide the unit testing classes from the checked in code that is ultimately built in ci.
The motivation for this is a library that I am working on is almost ready to go into production and Id rather not have the fake db context in my released library.
If there is a better way to handle this situation, please let me know!
How about you modify the template to put #if DEBUG {}
#if DEBUG
public class Fake...
{
}
#endif
around the Fake classes?
I considered that, but the next time I saved the tt file it would have wiped it out.
You could add that to the template, so every time you generate, its there.
Approx line 16835 you should find public override string FakeDatabaseContext(). At this location it's for EfCore. Add your #if statement here and at the bottom of the string (approx 17004).
Do the same for FakeDbSet() which is just below it.
I'll add a new Settings option to wrap the Fake* classes in a #if statement.
Thanks! ill go have a look at the template file and make the changes.