I am trying to write a unit test for a piece of code that generates a large amount of text. I ran into a problem where the "expected" and "actual" lines seem equal, but Assert.AreEqual throws out, and both equality and Equals() operators return false. The result of GetHashCode() is different for both values.
However, putting both lines in text files and comparing with DiffMerge, I am told that they are the same.
Also, using Encoding.ASCII.GetBytes() for both values, and then using SequenceEquals to compare the resulting byte arrays, returns true.
The values ββare 34K, so I will leave them here. Any ideas? I am completely at a dead end.
string equality c #
Daniel Schaffer
source share