2. The Visual Studio 2012 Unit Testing
experience is focused on
developers writing and running unit
tests while they write their code.
3. Years of customer feedback
• MS-Test Framework Issues
• MS-Test too slow
• Bad C/C++ support
• MS-Test missing new features
• Experience Issues
• Designed for testers not developers
• Not good for Agile & TDD
7. Use the framework you want to use
• In the box support for
• .NET
• Native C/C++
• Third party plugins
• NUnit
• xUnit.net
• MbUnit
• QUnit/Jasmine
• SQL Server Unit Testing
• Under development
8. MS-Test Improvements
• Many performance and scale improvements
• Especially when you stick to “classic” unit testing
• Support for testing Async
[TestMethod]
public async Task MyAsyncTest()
{
var result = await SomeLongRunningOperation();
Assert.IsTrue( result );
}
• Proper support for 64-bit and .Net multi-targeting
• Available in Express!
10. Isolating code for better testing
• The new VS11 Fakes framework lets you
isolate almost ANYTHING in .NET
• Fakes come in two flavors
• Stubs – concrete implementations of
interfaces or abstract classes
• Shims – run-time interception lets you
replace calls, even those from the .NET BCL
11. Using Fakes to create fast-
running, isolated unit tests
12. Code coverage in VS 2012
Analyze your code
coverage with a
single click
Analyze for selected
tests to help find
how specific tests
are covering your
system
Supports all
managed & native
frameworks
14. Team Foundation Build
• If it works in Visual Studio, it works on
Team Foundation Build
• 3rd party frameworks
• Visual Studio Fakes Isolation Framework
• Code Coverage
• Plus…
• Hosted Build (Team Build in the Cloud)
• Test Impact Analysis
15. Continuous Testing
• “If you aren’t running your unit
tests, you are just compiling. You are
not building.”
Chris Patterson
Program Manager
Team Foundation Build
• Run Tests After Build option in Visual
Studio 2012 will run your Unit Tests
after each successful build of your
solution
16. What’s missing?
• Test Lists
• Legacy mode only
• Test Impact
• Works on the server, not in the VS client
• Private accessors
• Deprecated in VS 2010, removed in VS
2012
17. The Visual Studio 2012 Unit Testing
experience is focused on
developers writing and running unit
tests while they write their code.