Session

Leveling Up: Unit Testing with C# [Workshop]

Unit testing can make you a faster developer. Good tests let us move forward more confidently, give us instant feedback when checking regression, and help us pinpoint bugs when things go wrong. In this workshop, we'll look at the qualities of good tests, including isolation, repeatability, runnability, and more. And we'll look at specific techniques that make our tests easy to ready, easy to write, and easy to run.

We'll go hands-on with TDD (Test-Driven Development) to see the red-green-refactor cycle in action. Some code is tricky to test: we'll look at how to test for exceptions and error states, and we'll use a mocking framework to create mocks and stubs. Tools include MSTest and NUnit (for testing) and Moq (for mocking), but the skills easily translate to other frameworks.

Objectives
o Why Unit Test? Getting the actual benefits
o Characteristics of a good unit test and how to implement them (including isolation, repeatability, runnability, and more)
o Basics of TDD
o Parameterizing tests
o Techniques for testing exceptions
o Using a mocking framework to isolate dependencies

Pre-Requisites
Basic understanding of C# and object-oriented programming (classes, inheritance, methods, and properties). In addition, experience with interfaces and other forms of abstraction is very helpful. No prior experience with unit testing is necessary; we'll take care of that as we go.

Jeremy Clark

Developer Betterer

Vancouver, Washington, United States

Actions

Please note that Sessionize is not responsible for the accuracy or validity of the data provided by speakers. If you suspect this profile to be fake or spam, please let us know.

Jump to top