While working on unit tests for a project which generates html using the Razor engine, I discovered a really weird scenario.
In order to get the unit test to be correct, I hard-coded the model, called the function, and saved the generated html code. Our business users viewed the generated html and gave the seal of approval, and our designers examined the html code and said everything looks good.
I now had an html file which I could use to compare against in the unit test to ensure that any changes to the code would not produce a different html file given the exact same model data.
On my local development machine, the unit test passes when comparing the byte array (File.ReadAllBytes(path)
). However, on our build agent the unit test fails due to extra ASCII 13 bytes, here is a snippet of a section of the byte arrays:
Build Agent: 111-100-121-62-13-10-32-32-32
Local Machine: 111-100-121-62-10-32-32-32
I'm not sure what is going on here or how to resolve this. Is this normal? How would I rewrite the test to fixes this?
Additional Information:
- The build agent is running Windows Server 2016, Visual Studio 2017 15.7.6
- My local development box is running Windows 10 Enterprise 10.0.14393, Visual Studio 2017 15.8.1