public async Task SimpleLookupsArePresentAndMatchExpectedCount(TypeOfIntegerCodedLookup thisKey, int expectedCount) { // arrange var internalDataCache = new InternalDataCache(); // act await NewService(internalDataCache).PopulateAsync(CancellationToken.None); // assert Assert.True(internalDataCache.IntegerLookups.ContainsKey(thisKey)); Assert.Equal(expectedCount, internalDataCache.IntegerLookups[thisKey].Count); }
/// <summary> /// Adds lookups. /// </summary> /// <param name="forThisKey">For this key.</param> /// <param name="usingSource">using source.</param> /// <param name="addToCache">add to cache.</param> public void AddLookups(TypeOfIntegerCodedLookup forThisKey, XElement usingSource, InternalDataCache addToCache) { var lookups = BuildListLookups <int>(usingSource, $"{forThisKey}"); addToCache.IntegerLookups.Add(forThisKey, lookups); }
public bool Contains(TypeOfIntegerCodedLookup lookupKey, int candidate) { return(_internalCache.IntegerLookups[lookupKey].Contains(candidate)); }
public IReadOnlyCollection <int> Get(TypeOfIntegerCodedLookup lookupKey) => _internalCache.IntegerLookups[lookupKey];