Unit Testing with Visual      Studio 2012
The Visual Studio 2012 Unit Testing     experience is focused ondevelopers writing and running unit tests while they write...
Years of customer feedback• MS-Test Framework Issues   • MS-Test too slow   • Bad C/C++ support   • MS-Test missing new fe...
Quick overview of the new Unit TestExplorer window
Developer Focused Unit Test Experience
Architecture
Use the framework you want to use• In the box support for   • .NET   • Native C/C++• Third party plugins   •   NUnit   •  ...
MS-Test Improvements• Many performance and scale improvements   • Especially when you stick to “classic” unit testing• Sup...
Unit testing async methods with MS-Test
Isolating code for better testing• The new VS11 Fakes framework lets you  isolate almost ANYTHING in .NET• Fakes come in t...
Using Fakes to create fast-running, isolated unit tests
Code coverage in VS 2012Analyze your codecoverage with asingle clickAnalyze for selectedtests to help findhow specific tes...
Code Coverage
Team Foundation Build• If it works in Visual Studio, it works on  Team Foundation Build   • 3rd party frameworks   • Visua...
Continuous Testing• “If you aren’t running your unit  tests, you are just compiling. You are  not building.”              ...
What’s missing?• Test Lists   • Legacy mode only• Test Impact   • Works on the server, not in the VS client• Private acces...
The Visual Studio 2012 Unit Testing     experience is focused ondevelopers writing and running unit tests while they write...
Upcoming SlideShare
Loading in …5
×

Unit testing with visual studio 2012

3,158 views

Published on

Published in: Technology, Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
3,158
On SlideShare
0
From Embeds
0
Number of Embeds
932
Actions
Shares
0
Downloads
34
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Unit testing with visual studio 2012

  1. 1. Unit Testing with Visual Studio 2012
  2. 2. The Visual Studio 2012 Unit Testing experience is focused ondevelopers writing and running unit tests while they write their code.
  3. 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
  4. 4. Quick overview of the new Unit TestExplorer window
  5. 5. Developer Focused Unit Test Experience
  6. 6. Architecture
  7. 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. 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!
  9. 9. Unit testing async methods with MS-Test
  10. 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. 11. Using Fakes to create fast-running, isolated unit tests
  12. 12. Code coverage in VS 2012Analyze your codecoverage with asingle clickAnalyze for selectedtests to help findhow specific testsare covering yoursystemSupports allmanaged & nativeframeworks
  13. 13. Code Coverage
  14. 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. 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. 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. 17. The Visual Studio 2012 Unit Testing experience is focused ondevelopers writing and running unit tests while they write their code.

×