I have two identical byte arrays in the following segment of code:
///
///A test for Bytes
///
[TestMethod()]
Because arrays don't override Equals
.
You haven't said which test framework you're using, but basically it would be up to that framework to special-case arrays. You can always implement your own helper method to do that, of course. I've done that sometimes. For a quick and dirty hack, if you're using .NET 3.5 you can use the Enumerable.SequenceEqual
extension method:
Assert.IsTrue(actual.SequenceEqual(expected));
A custom helper method could give you more details about how they differ, of course. You might find the methods in MoreLINQ.TestExtensions helpful, although they're fairly rough and ready too.