I'm writing a unit test for some .net code I've written.
I'm familiar with writing code like this:
int expected = 10;
int actual = multiplyByTwo(5);
Assert.AreEqual(expected, actual);
In the case that the arguments are integers, it's clear what to expect the code to do.
What does the code do when the arguments passed in are objects?
If I've written a custom classed called MyClass
, how can I control when Assert.AreEqual
passes and failed with objects of type MyClass
?