jeffkl / MSBuildProjectCreator

A fluent API for creating MSBuild projects for use by unit tests
MIT License
47 stars 4 forks source link

Convert bools to lowercase for XML spec compliance #271

Closed MattKotsenas closed 8 months ago

MattKotsenas commented 8 months ago

bool.ToString() returns an uppercase "True" or "False", but XML is case sensitive and specifies that bools should be lowercase (see https://learn.microsoft.com/en-us/dotnet/api/system.boolean.tostring).

While the built-in NuspecReader handles this, tools like NuGet Package Explorer do not. Update Package.WriteNuspec to emit lowercase bools.

I also added a basic unit test to catch accidental regressions.

MattKotsenas commented 8 months ago

whoops! directory separator issues; taking a look...

jeffkl commented 8 months ago

whoops! directory separator issues; taking a look...

There's an overload to .ShouldBe(string) that takes an option to ignore line breaks or something.

MattKotsenas commented 8 months ago

whoops! directory separator issues; taking a look...

There's an overload to .ShouldBe(string) that takes an option to ignore line breaks or something.

Thanks! I needed to both use that to normalize \n vs \r\n, and had to parameterize the expected string with Path.DirectorySeparatorChar. Let me know if anything looks out-of-place, or if there's a better way to accomplish the same thing. Thanks!