m31coding / M31.FluentAPI

Generate fluent builders for your C# classes with ease.
MIT License
94 stars 4 forks source link

Line Endings for test text is hardcoded #21

Closed DerekGooding closed 3 months ago

DerekGooding commented 3 months ago

I had issues using this on windows platform because the tests looked for \r\n instead of \n.

Suggest using System.Environment.NewLine as an alternative so that it is OS agnostic.

m31coding commented 3 months ago

Hi,

Thank you for this! You are right, there is a problem on Windows with the unit tests. Due to text=auto in the .gitattributes file, the line endings of the files CreateStudent.expected.txt are converted to CRLF on checkout on Windows.

I chose \n as the default line ending in the source generator to get deterministic behavior as per the recommendations. However, I think your solution to use Environment.NewLine is good and solves the issue.

Thanks for your contribution!