protected void InitializeSystemUnderTest(int cacheTimeoutInMinutes) { _systemUnderTest = new CachedSecurityRepository(_securityContextFactory, cacheTimeoutInMinutes); // Should hit the database on construction A.CallTo(() => _securityContextFactory.CreateContext()).MustHaveHappened(1, Times.Exactly); Fake.ClearRecordedCalls(_securityContextFactory); }
protected void InitializeSystemUnderTest(int cacheTimeoutInMinutes) { _systemUnderTest = new CachedSecurityRepository(_securityContextFactory, cacheTimeoutInMinutes); _systemUnderTest.GetClaimsForClaimSet("ClaimSet"); // Should hit the database after calling a getter because it has lazy initialization A.CallTo(() => _securityContextFactory.CreateContext()).MustHaveHappened(1, Times.Exactly); Fake.ClearRecordedCalls(_securityContextFactory); }