Exemple #1
0
        public void SolveFirstPuzzle()
        {
            var sut = new Foods(PuzzleData.PUZZLE_DATA);

            sut.CalculateIngredientsWithoutAllergens();
            Assert.Equal(2061, sut.ApparitionsOfIngredientsWithoutAllergensInFood);
        }
Exemple #2
0
        public void SolveSecondPuzzle()
        {
            var sut = new Foods(PuzzleData.PUZZLE_DATA);

            sut.CalculateIngredientsWithoutAllergens();
            Assert.Equal("cdqvp,dglm,zhqjs,rbpg,xvtrfz,tgmzqjz,mfqgx,rffqhl", sut.CanonicalDangerousIngredientList);
        }
Exemple #3
0
        public void CalculateAmountOfIngredientsWithoutAllergens()
        {
            const string data = @"mxmxvkd kfcds sqjhc nhms (contains dairy, fish)
trh fvjkl sbzzf mxmxvkd (contains dairy)
sqjhc fvjkl (contains soy)
sqjhc mxmxvkd sbzzf (contains fish)";

            var sut = new Foods(data);

            sut.CalculateIngredientsWithoutAllergens();
            Assert.Equal(5, sut.ApparitionsOfIngredientsWithoutAllergensInFood);
        }