public async Task CodedLookupsArePresentAndMatchExpectedCount(TypeOfStringCodedLookup thisKey, int expectedCount) { // arrange var internalDataCache = new InternalDataCache(); // act await NewService(internalDataCache).PopulateAsync(CancellationToken.None); // assert Assert.True(internalDataCache.StringLookups.ContainsKey(thisKey)); Assert.Equal(expectedCount, internalDataCache.StringLookups[thisKey].Count); }
public void TypeOfStringCodedLookupMeetsCasingExpectation(TypeOfStringCodedLookup thisKey, string candidate) { // arrange var sut = NewService(); var cache = sut.Create(); // act var result = cache.StringLookups[thisKey].Contains(candidate); // assert Assert.True(result); }
/// <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(TypeOfStringCodedLookup forThisKey, XElement usingSource, InternalDataCache addToCache) { var lookups = BuildStringListLookups(usingSource, $"{forThisKey}"); addToCache.StringLookups.Add(forThisKey, lookups); }
public bool Contains(TypeOfStringCodedLookup lookupKey, string candidate) { return(!string.IsNullOrWhiteSpace(candidate) && _internalCache.StringLookups[lookupKey].Contains(candidate)); }
public IReadOnlyCollection <string> Get(TypeOfStringCodedLookup lookupKey) => _internalCache.StringLookups[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(TypeOfStringCodedLookup lookupKey, string candidate) { return(It.Has(candidate) && InternalCache.StringLookups[lookupKey].Contains(candidate)); }