public void Should_find_a_dish_when_a_call_to_tryAddDish_has_success() { //arrange using (var dishesMenuService = new DishesMenuService()) { var tuple = (TimeOfDayType.Morning, DishType.Entree); var dish = new Dish("eggs", AllowedOrderType.Single); //act var addDishResult = dishesMenuService.TryAddDish(tuple, dish); var dishFound = dishesMenuService.FindDish(TimeOfDayType.Morning, DishType.Entree); //assert addDishResult.Should().BeTrue("Because there is no other dish that could cause a duplicated key"); dishFound.Should().Be(dish.Name, "Because the dish was added to the dictionary and can be retrieved by the key-pair (id) time of day and dish type"); } }
public void Should_be_empty_when_there_is_no_dish_with_the_timeOfDay_and_dishType_provided() { //arrange using (var dishesMenuService = new DishesMenuService()) { var tuple = (TimeOfDayType.Morning, DishType.Entree); var dish = new Dish("eggs", AllowedOrderType.Single); //act var addDishResult = dishesMenuService.TryAddDish(tuple, dish); var dishFound = dishesMenuService.FindDish(TimeOfDayType.Night, DishType.Entree); //assert addDishResult.Should().BeTrue("Because there is no other dish that could cause a duplicated key"); dishFound.Should().BeEmpty("Because the dish is not in to the dictionary and cannot be retrieved by the key-pair (id) time of day and dish type"); } }