Beispiel #1
0
    public void WithArguments()
    {
        /* Given */
        Directive original = "@a(x: 100, y: 100)";

        /* When */
        var modified = original
                       .WithArguments(
            new List <Argument>(original.Arguments ?? Enumerable.Empty <Argument>())
            .Concat(new[]
        {
            new Argument("x", new IntValue(100))
        }).ToList()
            );

        /* Then */
        Assert.Equal(2, original.Arguments?.Count);
        Assert.Equal(3, modified.Arguments?.Count);
    }