Esempio n. 1
0
        public void ShouldWrapUncachingComponent()
        {
            var uncached = new ObjectReturningNewGuidsNoInterface();

            uncached.CachedMethod().Should().Not.Be.EqualTo(uncached.CachedMethod());

            var cached = factory.ToCachedComponent(uncached);

            cached.CachedMethod().Should().Be.EqualTo(cached.CachedMethod());
        }
        public void ShouldWrapUncachingComponent()
        {
            var uncached = new ReturningRandomNumbers();

            uncached.CachedNumber().Should().Not.Be.EqualTo(uncached.CachedNumber());

            var cached = factory.ToCachedComponent <IReturningRandomNumbers>(uncached);

            cached.CachedNumber().Should().Be.EqualTo(cached.CachedNumber());
        }
Esempio n. 3
0
 public void ShouldThrowIfNonCachedComponentIsUsed()
 {
     Assert.Throws <ArgumentException>(() => factory.ToCachedComponent(new object()));
 }