示例#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);
        }