public void Part2Test() { // Given var rules = new LuggageRuleSet(Input.GetLines(7).Select(x => new LuggageRule(x))); // When var count = rules.CountBags("shiny gold"); // Then Assert.Equal(32, count); }
public void Part1Test() { // Given var rules = new LuggageRuleSet(Input.GetLines(7).Select(x => new LuggageRule(x))); // When var colors = rules.Rules.Select(x => x.Color); var canHoldShinyGold = colors.Where(x => rules.CanEventuallyContain(x, "shiny gold")) .OrderBy(x => x); // Then Assert.Equal(new [] { "bright white", "dark orange", "light red", "muted yellow" }, canHoldShinyGold); }