Using Assert.AreSame
Posted by: Karl Seguin [MVP],
on 04 Nov 2008 |
View original | Bookmarked: 0 time(s)
Just as an aside, Part 2 of my jQuery article is up.
I think this is something most people know, but wanted to throw it out there just in case. There are subtleties that should be understood when using Assert.AreSame(expected, actual) over other Asserts. AreSame does a reference check, which is often more telling and accurate than a value check. For example, given the following method which creates a new version of a User:public User Version(string newName)
{
var newUser = this.Clone();
newUser.Name...