Suppose that I have the following code:
public Item CoolFunction(int i) {
var result = SomeContext.Item.First(t => t.Id == i);
return result;
}
Suppose for whatever reason I want to unit test this method. In this case, I can use MS Fakes to fake the context. But if I want to test this code against a real Db, I have to write another unit test to do so. Is there a (nice or convenient or recommended) way to write one unit test with a switch that can test with the fake context or real db?