Esempio n. 1
0
        public void UseAsKey_Expression_CallsTrackExpressionWithProperParameter()
        {
            var result = _sut.UseAsKey(u => u.Name);

            result.Should().NotBeNull();
            _propertyTrackerMock
            .Verify(p => p.TrackExpression(It.IsAny <Expression <Func <User, string> > >()), Times.Once);
        }
 protected override AndBuilder <CacheImplementationBuilder> Configure(CachingKeyBuilder <User> builder) =>
 builder.UseAsKey("user")
 .CombinedWith(_ => _.Id)
 .CombinedWith(_ => _.FirstName)
 .CombinedWith(_ => _.LastName)
 .And().WithTtlOf(5).Seconds
 .And().SlidingExpiration();