public void LookupReturnsStoredInstance() { var key = BuildKey("c\\v", "shared\\m"); var entry = new CompiledViewHolder.Entry { Key = key, Loader = new ViewLoader() }; Assert.IsNull(holder.Lookup(key)); holder.Store(entry); Assert.AreSame(entry, holder.Lookup(key)); }
public void ExpiredEntryReturnsNull() { var loader = MockRepository.GenerateMock<ViewLoader>(); isCurrent = true; Func<bool> foo = () => isCurrent; loader.Stub(x => x.IsCurrent()).Do(foo); var key = BuildKey("c\\v", "shared\\m"); var entry = new CompiledViewHolder.Entry { Key = key, Loader = loader }; holder.Store(entry); Assert.AreSame(entry, holder.Lookup(key)); isCurrent = false; Assert.IsNull(holder.Lookup(key)); }