public void ByTypeInject() { const string TEST_STR = "test string"; SunsetLake lake = new SunsetLake(); lake.RegisterSingleton <string>(TEST_STR); var instance = new InjectTarget(); new DependenciesInjector(instance, lake).Inject(); Assert.IsTrue(instance.Str == TEST_STR); }
public void IntelliInject() { SunsetLake lake = new SunsetLake(); lake.Register <DateTime>(() => DateTime.Now); var instance = new InjectTarget(); var originalDateTime = instance.CreateDateTime; new DependenciesInjector(instance, lake).Inject(); Assert.IsTrue(instance.CreateDateTime != originalDateTime); }