public void GetBestCoverage_ThrowsArgumentOutOfRangeException_WhenRequiredItemsNotContained() { var testAvailableItemSetList = new List <ValueTuple <string, HashSet <string> > >() { ("ValidItem1", new HashSet <string>() { "D" }) }; var testRequiredItemsHashSet = new HashSet <string>() { "A", "B", "C" }; Assert.That(() => SetCoveringFunctions.GetBestCoverage(testAvailableItemSetList, testRequiredItemsHashSet), Throws.TypeOf <ArgumentOutOfRangeException>()); }
public void GetBestCoverage_ReturnsList_WhenAvailableItemSetContainsRequiredItems() { var testAvailableItemSetList = new List <ValueTuple <string, HashSet <string> > >() { ("ValidItem1", new HashSet <string>() { "NOR", "DEN", "SWE" }), ("ValidItem2", new HashSet <string>() { "SCO", "FRA", "NOR" }), ("ValidItem3", new HashSet <string>() { "EST", "GER", "DEN" }), ("ValidItem4", new HashSet <string>() { "DEN", "SWE" }), ("ValidItem5", new HashSet <string>() { "GER", "IT" }) }; var testRequiredItemsHashSet = new HashSet <string>() { "SCO", "FRA", "EST", "NOR", "DEN", "SWE", "GER", "IT" }; var expectedResult = new List <string> { "ValidItem1", "ValidItem2", "ValidItem3", "ValidItem5" }; var result = SetCoveringFunctions.GetBestCoverage(testAvailableItemSetList, testRequiredItemsHashSet); Assert.AreEqual(expectedResult, result); }
public void GetBestCoverage_ThrowsArgumentException_WhenArgumentIsEmpty(List <ValueTuple <string, HashSet <string> > > testAvailableItemSetList, HashSet <string> testRequiredItemsHashSet) { Assert.That(() => SetCoveringFunctions.GetBestCoverage(testAvailableItemSetList, testRequiredItemsHashSet), Throws.ArgumentException); }