Exemplo n.º 1
0
        public void RegisterTest()
        {
            IRegisterableLake lake = new SunsetLake();
            int time = 0;

            lake.Register <int>(() => time++);

            Assert.IsTrue((lake.Get <int>() - lake.Get <int>()) == -1);
        }
Exemplo n.º 2
0
        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);
        }