예제 #1
0
        public static void TestSet14_Method1()
        {
            //TestSet14
            var container = new Container();

            container.RegisterType <SqlDataRepository>();
            container.RegisterType <ServiceDataRepository>();
            var sql  = new SqlDataRepository();
            var srv1 = (ServiceDataRepository)container.CreateInstance("Build.Tests.TestSet14.ServiceDataRepository(Build.Tests.TestSet14.SqlDataRepository)", sql);

            Assert.NotNull(srv1);
        }
예제 #2
0
        public static void TestSet14_Method6()
        {
            //TestSet14
            var container = new Container();

            container.RegisterType <SqlDataRepository>();
            container.RegisterType <ServiceDataRepository>();
            var sql  = new SqlDataRepository();
            var srv1 = (ServiceDataRepository)container.CreateInstance("Build.Tests.TestSet14.ServiceDataRepository(Build.Tests.TestSet14.SqlDataRepository)", sql);
            var srv2 = (ServiceDataRepository)container.CreateInstance("Build.Tests.TestSet14.ServiceDataRepository(Build.Tests.TestSet14.SqlDataRepository)", new object[] { null });

            Assert.NotEqual(srv1.Repository, srv2.Repository);
        }