public async Task CodedLookupsArePresentAndMatchExpectedCount(LookupCodedKey thisKey, int expectedCount) { // arrange var internalDataCache = new InternalDataCache(); // act await NewService(internalDataCache).PopulateAsync(CancellationToken.None); // assert Assert.True(internalDataCache.CodedLookups.ContainsKey(thisKey)); Assert.Equal(expectedCount, internalDataCache.CodedLookups[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(LookupCodedKey forThisKey, XElement usingSource, InternalDataCache addToCache) { var lookups = BuildSimpleLookupEnumerable <string>(usingSource, $"{forThisKey}"); addToCache.CodedLookups.Add(forThisKey, lookups.ToList()); }
/// <summary> /// As a set. /// </summary> /// <param name="lookupKey">The lookup key.</param> /// <returns>the domain of values pertinent to the coded lookup key</returns> public IReadOnlyCollection <string> AsASet(LookupCodedKey lookupKey) { return(InternalCache.CodedLookups[lookupKey]); }
/// <summary> /// Determines whether [the specified lookup key] [contains] the value. /// </summary> /// <param name="lookupKey">The lookup key.</param> /// <param name="candidate">The candidate.</param> /// <returns> /// <c>true</c> if [the specified lookup] [contains]; otherwise, <c>false</c>. /// </returns> public bool Contains(LookupCodedKey lookupKey, string candidate) { return(InternalCache.CodedLookups[lookupKey].Contains(candidate)); }