Ejemplo n.º 1
0
        public void ShouldCache()
        {
            using (var factory = new CacheBuilder(_proxyFactory)
                                 .For <ObjectReturningNewGuids>()
                                 .CacheMethod(c => c.CachedMethod())
                                 .As <IObjectReturningNewGuids>()
                                 .BuildFactory())
            {
                var component = factory.Create <IObjectReturningNewGuids>();

                component.CachedMethod().Should().Be.EqualTo(component.CachedMethod());
            }
        }
Ejemplo n.º 2
0
		public void ShouldCache()
		{
			using (var factory = new CacheBuilder(_proxyFactory)
				.For<ObjectReturningNewGuids>()
				.CacheMethod(c => c.CachedMethod())
				.As<IObjectReturningNewGuids>()
				.BuildFactory())
			{
				var component = factory.Create<IObjectReturningNewGuids>();

				component.CachedMethod().Should().Be.EqualTo(component.CachedMethod());
			}
		}