var expectedMessage = string.Join(Environment.NewLine, new string[]{
"1: Fake call 1",
"2: Fake call 2",
"3: Fake call 3",
"4: Fake call 4",
"5: Fake call 5",
"6: Fake call 6",
"7: Fake call 7",
"8: Fake call 8",
"9: Fake call 9",
"10: Fake call 10"});
var expectedMessage =
@"1: Fake call 1
2: Fake call 2
3: Fake call 3
4: Fake call 4
5: Fake call 5
6: Fake call 6
7: Fake call 7
8: Fake call 8
9: Fake call 9
10: Fake call 10";
Hi, @LukeMarlin. I'm glad dotnet test is running, even though it fails.
I am not sure about the best approach for updating these tests. Your proposed one looks like it would work, but we also use $@
strings which would make things more complicated.
It would be possible to add the Replace
at the end of the $
string or $@
string rather than converting to use a Join
, no?
Perhaps nicer would be to add a utility method in FakeItEasy.Tests.TestHelpers
to do the conversion. Something like
var expectedMessage = Multiline(
@"1: Fake call 1
2: Fake call 2
3: Fake call 3
4: Fake call 4
5: Fake call 5
6: Fake call 6
7: Fake call 7
8: Fake call 8
9: Fake call 9
10: Fake call 10");
And it could adust the line endings if needed.
Alternatively, I suppose we could have the repo adjust its line endings to be native when checked out, but that makes me nervous.
I'm not trying your build scripts yet
I don't expect major difficulties here. The build.cmd just invokes dotnet
, so it should be easy to translate to bash.
Doesn't FluentAssertions have an option to ignore differences in line breaks?
I couldn't find it.
The build.cmd just invokes dotnet, so it should be easy to translate to bash.
It's true. Even tried this approach yesterday, but I had only a core 3.0 preview on my WSL, so things did not go well!
MatchEquivalentOf
will ignore ends of lines and case, which is close. Looking to see if we can turn on only one of those switches!
autocrlf
probably comes into play here too
NormalizeLineEndings
-type extension method or specialized FluentAssertion comparers. The latter is probably slightly cleaner as we don't have to pollute string
, but it would just be in the tests, and I think not such a big deal.