C# – Use StringAssert when testing a string for substrings
When you’re testing if two strings are equal, you can simply use Assert.AreEqual(). When you’re testing if a string contains a substring or a pattern, typically developers use Assert.IsTrue() with a substring method or regex. You should use StringAssert instead, because it gives better failure messages. Note: StringAssert is nice because it’s a built-in class. … Read more