Exemplo n.º 1
0
        public void TestReturnsImplementation()
        {
            object           expectedService = new object();
            InstanceStrategy strategy        = new InstanceStrategy(expectedService);

            object actualService = strategy.LocateService();

            Assert.Equal(expectedService, actualService);
        }
Exemplo n.º 2
0
		public void ActivateTest()
		{
			FauxInjectionScope scope = new FauxInjectionScope();
			FauxInjectionContext context = new FauxInjectionContext { RequestingScope = scope };

			BasicService basicService = new BasicService();

			InstanceStrategy<IBasicService> instanceStrategy = new InstanceStrategy<IBasicService>(basicService);

			object activatedObject = instanceStrategy.Activate(scope, context, null, null);

			Assert.True(ReferenceEquals(activatedObject, basicService));
		}
Exemplo n.º 3
0
 void Awake()
 {
     location    = gameObject.GetComponent <PositionStrategy>();
     typeToSpawn = gameObject.GetComponent <InstanceStrategy>();
 }