mikebridge / Liquid.NET

.Net Port of the Liquid template language
MIT License
61 stars 15 forks source link

LiquidValueConverter ignores static properties. Fix for #69. #70

Closed robertwesterlund closed 6 years ago

robertwesterlund commented 6 years ago

This Pull Request changes the behavior of the LiquidValueConverter so that it ignores static properties (only includes public instance properties with a getter).

That changes the observed behavior of the following code:

public class ViewModel
{
    public string Title { get; set; }
    public static string OtherData { get; set; }
}

ViewModel.OtherData = "aaa";
var liquid = new ViewModel() { Title = "bbb" }.ToLiquid();

The behavior is changed from liquid having two properties, both the Title and the OtherData property to instead only including the Title property.

This fixes #69, in case you agree with the issue.

codecov-io commented 6 years ago

Codecov Report

Merging #70 into master will increase coverage by <.01%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #70      +/-   ##
==========================================
+ Coverage   91.95%   91.95%   +<.01%     
==========================================
  Files         140      140              
  Lines        4921     4922       +1     
  Branches      453      453              
==========================================
+ Hits         4525     4526       +1     
  Misses        286      286              
  Partials      110      110
Impacted Files Coverage Δ
Liquid.NET/src/Utils/LiquidValueConverter.cs 98.44% <100%> (+0.01%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 988bc1d...cef3c68. Read the comment docs.