Skip to content

Commit

Permalink
Added test: <variable> with attr and <value> (#3479)
Browse files Browse the repository at this point in the history
  • Loading branch information
304NotModified committed Jun 13, 2019
1 parent a238637 commit d85b7f5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/NLog.UnitTests/Config/VariableTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,19 @@ public void Xml_configuration_with_inner_returns_defined_variables_withValueElem
Assert.Equal("]]", configuration.Variables["suffix"].Render(nullEvent));
}

[Fact]
public void Xml_configuration_variableWithInnerAndAttribute_attributeHasPrecedence()
{
var configuration = XmlLoggingConfiguration.CreateFromXmlString(@"
<nlog throwExceptions='true'>
<variable name='var1' value='1'><value>2</value></variable>
</nlog>");

var nullEvent = LogEventInfo.CreateNullEvent();

// Act & Assert
Assert.Equal("1", configuration.Variables["var1"].FixedText);
}

[Fact]
public void NLogConfigurationExceptionShouldThrown_WhenVariableNodeIsWrittenToWrongPlace()
Expand Down

0 comments on commit d85b7f5

Please sign in to comment.