public void LavaTypeAttribute_WithNamedPropertyMarkedAsIgnored_DoesNotExposeIgnoredProperty() { var testObject = new TestLavaTypeAttributeWithNamedPropertiesClass(); var mergeValues = new LavaDataDictionary { { "PersonInfo", testObject } }; var template = @" Name: {{ PersonInfo.Name }} Password: {{ PersonInfo.Password }} "; var expectedOutput = @" Name: Ted Decker Password: "; // Password value should be omitted even though it is named in the whitelist, because it is marked with the LavaIgnore attribute. TestHelper.AssertTemplateOutput(expectedOutput, template, mergeValues, ignoreWhitespace: true); }
public void LavaTypeAttribute_WithNamedProperties_DoesNotExposeUnnamedUndecoratedProperty() { var testObject = new TestLavaTypeAttributeWithNamedPropertiesClass(); var mergeValues = new LavaDataDictionary { { "PersonInfo", testObject } }; var template = @" Name: {{ PersonInfo.Name }} Date of Birth: {{ PersonInfo.DateOfBirth }} "; var expectedOutput = @" Name: Ted Decker Date of Birth: "; // Date of Birth should be omitted because it is not a named as a Lava property. TestHelper.AssertTemplateOutput(expectedOutput, template, mergeValues, ignoreWhitespace: true); }