Exemple #1
0
 static void Main(string[] args)
 {
     var client01 = new Client01();
     var salutation = client01.GetGreeting();
     Console.WriteLine(salutation);
     Console.WriteLine("Any key to exit.");
     Console.ReadKey();
 }
Exemple #2
0
        static void Main(string[] args)
        {
            var client01   = new Client01();
            var salutation = client01.GetGreeting();

            Console.WriteLine(salutation);
            Console.WriteLine("Any key to exit.");
            Console.ReadKey();
        }
        public void Test()
        {
            IServiceInstance inst01 = new SrvInst01();
            IServiceInstance inst02 = new SrvInst02();

            IServiceProducer[] services =
            {
                new TestServiceProducer(new[] { inst01 }),
                new TestServiceProducer(new[] { inst02 })
            };

            var cont = CreateContainer(services);

            cont.ResolveStatic(typeof(Client01));

            Assert.AreEqual(
                Client01.StaticSrv1,
                inst01,
                "Should resolve static"
                );

            Assert.AreEqual(
                Client01.StaticSrv2,
                inst02,
                "Should resolve static"
                );

            var client = new Client01();

            Assert.AreEqual(
                client.Srv01,
                inst01,
                "Should resolve"
                );

            Assert.AreEqual(
                client.Srv02,
                inst02,
                "Should resolve"
                );
        }