Dave Lloyd Unit Testing in the Real World
Anatomy of a Test Fixture Beware of the.VSMDI Using the.testrunconfig Expected Exceptions Data Driven Tests Mock Objects Ignore & Inconclusive Test Driven Development Static Code Analysis and Code Coverage
Test Class and Test Method TestContext Property
Meta Data for Test Manager Must have VS for Testers or Team Suite Not a part of VS for Developers Don’t Merge this file! To add tests to a Team Build you need this file
Creating and using your own Deployment Code Coverage Setup and Cleanup Batch Files
ExpectedException Attribute Validate the correct Exception was raised
DataSource Attribute Execute a test using test data
The Crash Test Dummies of Unit Testing Simulated Object Same Interface as the Real Object Why Create a Mock Object Real one doesn’t exist yet Difficult to produce within a test
Ignore Tell VSTS to ignore a test Assert.Inconclusive Show test in test results with message Reminder of an Inconclusive Test
Available in C# The Process Write a Test Execute and see it fail Write the code Execute the test and see it pass Smart Tag allowing you to Generate a method Stub in the code being tested
Blogs on TDD: James Newkirk - blogs.msdn.com/jamesnewkirk Brian Marick - Jonathan de Halleux - Jose Almeida - blogs.msdn.com/josealmeida/ Scott Densmore – blogs.msdn.com/scottdensmore Code Project - TestDriven.com - Books: Test-Driven Development in Microsoft.Net By James W. Newkirk & Alexei A. Vorontsov Test Driven Development: A Practical Guide By David Astels Test Driven Development: by Example By Kent Beck
Unit Testing in the Real World Dave Lloyd Partner, ObjectSharp Consulting
Assert CollectionAssert To Compare Collections of Objects StringAssert To Compare Strings
UnitTestAssertException Base Exception AssertFailesException Thrown when an Assertion Fails AssertInconclusiveException Test is not complete InternalTestFailureException Internal failure for a test
Unit Testing in the Real World Dave Lloyd