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...

Advertisement
Free Agile Project Management Tool from Telerik
TeamPulse Community Edition helps your team effectively capture requirements, manage project plans, assign and track work, and most importantly, be continually connected with each other.
Category: Debugger | Other Posts: View all posts by this blogger | Report as irrelevant | View bloggers stats | Views: 2145 | Hits: 47

News Categories

.NET | Agile | Ajax | Architecture | ASP.NET | BizTalk | C# | Certification | Data | DataGrid | DataSet | Debugger | DotNetNuke | Events | GridView | IIS | Indigo | JavaScript | Mobile | Mono | Patterns and Practices | Performance | Podcast | Refactor | Regex | Security | Sharepoint | Silverlight | Smart Client Applications | Software | SQL | VB.NET | Visual Studio | W3 | WCF | WinFx | WPF | WSE | XAML | XLinq | XML | XSD