コード例 #1
0
        public void GivenExistingIngredientName_WhenAskingToMap_ThenItShouldReturnCorrectIngredient()
        {
            // arrange
            const string  name          = "Olives";
            IngredientMap ingredientMap = new IngredientMap();

            // act
            IIngredient mappedIngredient = ingredientMap.DomainIngredient(name, new Pizza(), new BedrockLocation());

            // assert
            mappedIngredient.Name().ToString().Should().BeEquivalentTo(new OlivesName());
        }
コード例 #2
0
        public void GivenExistingAlternativeIngredientName_WhenAskingToMap_ThenItShouldReturnCorrectIngredient()
        {
            // arrange
            const string  name          = "Crispy Ham";
            IngredientMap ingredientMap = new IngredientMap();

            // act
            IIngredient mappedIngredient = ingredientMap.DomainIngredient(name, new Pizza(), new SpringfieldLocation());

            // assert
            mappedIngredient.Name().ToString().Should().BeEquivalentTo(new CrispyHamName());
            mappedIngredient.GetType().Name.Should().Be(nameof(CrispyHam));
        }