Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 3
0
 public bool Contains(TypeOfIntegerCodedLookup lookupKey, int candidate)
 {
     return(_internalCache.IntegerLookups[lookupKey].Contains(candidate));
 }
Ejemplo n.º 4
0
 public IReadOnlyCollection <int> Get(TypeOfIntegerCodedLookup lookupKey) =>
 _internalCache.IntegerLookups[lookupKey];