C# string equality operator returns false, but I'm pretty sure it should be true... What?!
- by Daniel Schaffer
I'm trying to write a unit test for a piece of code that generates a large amount of text. I've run into an issue where the "expected" and "actual" strings appear to be equal, but Assert.AreEqual throws, and both the equality operator and Equals() return false. The result of GetHashCode() is different for both values as well.
However, putting both…