diff --git a/ObjectSemantics.NET.Tests/IfConditionTests.cs b/ObjectSemantics.NET.Tests/IfConditionTests.cs index d250295..26666e8 100644 --- a/ObjectSemantics.NET.Tests/IfConditionTests.cs +++ b/ObjectSemantics.NET.Tests/IfConditionTests.cs @@ -112,5 +112,23 @@ public void Should_Evaluate_String_Conditions_If_Blocks(string name, string expe string result = person.Map(template); Assert.Equal(expected, result); } + + [Theory] + [InlineData(40, "[Adult]|[CanTakeAlcohol]")] + [InlineData(18, "[Adult]|[CanTakeAlcohol]")] + [InlineData(0, "[Minor]|[NoAlcohol]")] + [InlineData(-7, "[Minor]|[NoAlcohol]")] + public void Should_Render_Multiple_If_Condition_Statements(int age, string expected) + { + Person person = new Person + { + Age = age + }; + + string template = @"{{ #if(Age >= 18) }}[Adult]{{ #else }}[Minor]{{ #endif }}|{{ #if(Age < 18) }}[NoAlcohol]{{ #else }}[CanTakeAlcohol]{{ #endif }}"; + + string result = person.Map(template); + Assert.Equal(expected, result); + } } }