Пример #1
0
        protected override void TestSetup()
        {
            eventListener = new EventListenerForTest();
            CacheBuilder.AddEventListener(eventListener);

            CacheBuilder
            .For <ObjectWithParametersOnCachedMethod>()
            .CacheMethod(c => c.CachedMethod(null))
            .As <IObjectWithParametersOnCachedMethod>();

            factory = CacheBuilder.BuildFactory();
        }
Пример #2
0
		protected override void TestSetup()
		{
			eventListener = new EventListenerForTest();
			CacheBuilder.AddEventListener(eventListener);

			CacheBuilder
				 .For<ObjectWithParametersOnCachedMethod>()
				 .CacheMethod(c => c.CachedMethod(null))
				 .As<IObjectWithParametersOnCachedMethod>();
			
			factory = CacheBuilder.BuildFactory();
		}
Пример #3
0
		protected override void TestSetup()
		{
			eventListener = new EventListenerForTest();
			CacheBuilder
				.For<ObjectReturningNull>()
					.CacheMethod(c => c.ReturnNullIfZero(0))
					.As<IObjectReturningNull>()
				.AddEventListener(eventListener);

			var factory = CacheBuilder.BuildFactory();
			var comp = factory.Create<IObjectReturningNull>();
			comp.ReturnNullIfZero(0);
			comp.ReturnNullIfZero(1);
		}
Пример #4
0
        protected override void TestSetup()
        {
            eventListener = new EventListenerForTest();
            CacheBuilder
            .For <ObjectReturningNull>()
            .CacheMethod(c => c.ReturnNullIfZero(0))
            .As <IObjectReturningNull>()
            .AddEventListener(eventListener);

            var factory = CacheBuilder.BuildFactory();
            var comp    = factory.Create <IObjectReturningNull>();

            comp.ReturnNullIfZero(0);
            comp.ReturnNullIfZero(1);
        }