📄 test/JsonLdRecipeParser.Tests/IngredientTests/FromShould.cs
using JsonLdRecipeParser.Json;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Shouldly;

namespace JsonLdRecipeParser.Tests.IngredientTests;

[TestClass]
public class FromShould
{
    [TestMethod]
    public void MapAStringRecipeIngredient()
    {
        // Arrange
        var ingredient = new RecipeIngredient { Value = "12g sugar" };

        // Act
        var result = Ingredient.From(ingredient);

        // Assert
        result.ShouldBeEquivalentTo(
            new Ingredient
            {
                Name = "sugar",
                Amount = new Amount { Value = new ExactAmountValue(12.0d), Unit = "g" },
            }
        );
    }
}