Пример #1
0
        public void TestAspect()
        {
            ObjectContainer.SetContainer(new AutofacObjectContainer());
            ObjectContainer.Register <ITestAspect, TestAspect>();
            ObjectContainer.Build();

            var service = ObjectContainer.Resolve <ITestAspect>();

            Assert.AreEqual(service.T(), true);
        }
Пример #2
0
        public void TestAutofac()
        {
            ObjectContainer.SetContainer(new AutofacObjectContainer());
            ObjectContainer.Register <MockTestService, MockTestService>();
            ObjectContainer.Build();

            var service = ObjectContainer.Resolve <MockTestService>();

            Assert.AreNotEqual(service, null);
            Assert.AreEqual(service.Test(), true);
        }
Пример #3
0
 public static void Build()
 {
     ObjectContainer.Build();
 }
Пример #4
0
 public void TestBasic()
 {
     ObjectContainer.SetContainer(new MockObjectContainer());
     ObjectContainer.Build();
 }
Пример #5
0
 public Configuration BuildContainer()
 {
     ObjectContainer.Build();
     return(this);
 }