Example #1
0
        public void ServiceChainTest()
        {
            var api = new TestApiC();

            var handler = api.Context.GetApiService <IServiceB>();

            Assert.Equal("q2Pre_q1Pre_q1Post_q2Post_", handler.GetStr());
        }
        public void ContextApiScopeWorksCorrectly()
        {
            var api      = new TestApiC();
            var service1 = api.Context.GetApiService <ISomeService>();

            var api2     = new TestApiC();
            var service2 = api2.Context.GetApiService <ISomeService>();

            Assert.NotEqual(service1, service2);

            var api3     = new TestApiC();
            var service3 = api3.Context.GetApiService <ISomeService>();

            Assert.NotEqual(service3, service2);
        }