Server Side Unit TestingPRESENTED BY: THE PANTHERS
Why do we unit test?
Is that not QA’s job?
Pros:• Design Methods in a more modular fashion
• Provides Documentation of code
• Helps reduce manual testing
• Allows regression of code
• Catches bugs early
Previous Technology Used:• Nunit
• Inline DataBuilders
• Asserts and Nunit Asserts
• RhinoMoqs
Current Technology
Shouldly:• Tons of great documentation - http://docs.shouldly-
lib.net/v2.4.0/docs/overview
• Fluent and human readable
• Failure messages point to the where it failed
• Has a funny failure message – Chucked a Wobbly
AutoFixture:• Tons of great documentation -
https://github.com/AutoFixture/AutoFixture/wiki/Cheat-Sheet
• Automatic creation of simple and complex types
• Inline
• Constructors
• Custom
• Easily extensible to help build types
Moq:• Tons of great documentation -
https://github.com/Moq/moq4/wiki/Quickstart
• Made for .Net in mind
• Linq to Mocks
• Able to Mock Events, Callbacks, Properties, Arguments and Asynchronous
Calls
• Can Mock Protected Members
• Can Mock Interfaces and Classes
• Can intercept and raise events on mocks
Xunit:• Tons of great documentation - http://xunit.github.io/docs/getting-
started.html
• Made for .Net in mind
• Uses the C# framework of instead of custom attributes
• Is extensible to use Theories, Autodata, AutoRollback, InlineData
• Works great with other frameworks such as Moq and AutoFixture
Future Technololgy
Questions?
We have answers!!!
Image References:• Paul McRae (Delta Diner) Flickr
• Andy Armstrong (Perl QA Hackathon) Flickr
• CltreonAZU (Bug Line-up) Flickr
• Paul (Panasonic Lumix GM1) Flickr
• Stilgherrian (Nokia Lumia 925) Flickr
• Kyle Miron (Hey WoodChuck!) Flickr
• Joe Penniston (Disney - Magic Music Mayhem 2) Flickr
• GfPeck (Blue on Black) Flickr
• XgamesBarcelona www.barcelonablog.net
• Microsoft Sweden (win10_HoloLens_livingRoom) Flickr
• Derek Bridges (Questions) Flickr
• Robert Claypool (Nashville Public Library, Grand Reading Room)