Ejemplo n.º 1
0
        public void OneVegetarianDietWithSixMeals()
        {
            //Arrange
            DietService dietService = new DietService();;

            Dictionary <Diet, int> expectedDictionary = new Dictionary <Diet, int>();

            expectedDictionary.Add(Diet.VEGETARIAN, 6);

            List <Participant> participants = new List <Participant>();
            var bob = new Participant("Bob");

            bob.Diet = Diet.VEGETARIAN;
            participants.Add(bob);

            var participant2 = new ParticipantBuilder()
                               .WithName("BOB")
                               .WithDiet(Diet.VEGETARIAN)
                               .Build();

            //Act
            var result = dietService.AggregateToDictionary(participants);

            //Assert
            Assert.AreEqual(expectedDictionary[Diet.VEGETARIAN], result[Diet.VEGETARIAN]);
        }