private T RetrieveOrCreateFunction <T>(Type type) where T : class { CodeIsUnderTest = true; if (!ActiveFakes.ContainsKey(type)) { ActiveFakes.Add(type, (StubBase)Activator.CreateInstance(type)); } return(ActiveFakes[type] as T); }
private T RetrieveOrCreateFunction <T>(Func <T> factory) where T : StubBase { var type = typeof(T); CodeIsUnderTest = true; if (!ActiveFakes.ContainsKey(type)) { ActiveFakes.Add(type, factory.Invoke()); } return(ActiveFakes[type] as T); }