Call Us: +32 2 466 00 16
Email: info@u2u.be
Follow Us:

Effective Unit Testing

2 days
uec7
2 days

Upcoming Sessions

Date: currently not scheduled

Format: Classroom

Price: 950€


Date: currently not scheduled

Format: Remote Classroom

Price: 0€


Subscribe to waiting list

Date: currently not scheduled

Format: Classroom

Price: 950€


Date: currently not scheduled

Format: Remote Classroom

Price: 0€


Subscribe to waiting list

Interested in a private company training? Request it here.

Unit testing in .NET

Every developer want clean code that works. So how does one get to maintainable and working code? And moreover: keep it working.

  • What every developer wants: Quality code that works; and keeps on working
  • Finding bugs: not just in code. - Or how NASA lost a 125.000.000$ Mars orbiter
  • What is unit testing? And what is a good unit test?
  • Understanding the difference between a unit test and an integration test
  • Test Driven Development - Should you be doing it?
  • Role-playing: Marge, Homer and Bart
  • The Triple-A of unit testing - and what has cooking to do with this?

Unit testing with Visual Studio with MSTest and XUnit

When Unit Testing, you will have to decide on frameworks. There are several ones out there, but which one do you need? Visual Studio comes with a built in framework called MSTest, but you also have others, like the popular XUnit. In this module, we will discuss pros and cons of these frameworks, and go into some best practices. How do I know if I have tested enough? With code coverage you can see which paths in your code you have tested, and easily discover untested conditional logic.

  • MSUnit - Built-in into Visual Studio
  • Building and running Unit Tests with MSUnit
  • Using the Test Explorer Window
  • Using Test Settings
  • Live unit testing with Visual Studio
  • Unit Testing best practices with XUnit
  • Facts and Theories
  • Unit testing parallelism
  • Measuring and improving Code Coverage
  • And what about Performance Testing?
  • LAB: Implementing a library with testing

Writing testable code

If you want your code to be testable, you have to engineer your code for testing. You will learn about Stubs and Mocks, and how to replace dependencies that might interfere with testing.

  • Testing dependencies - and the art of writing testable code
  • The difference between a Stub and a Mock
  • How to replace dependencies with stub and mock objects
  • The Extract and Override pattern
  • How the MVVM pattern facilitates UI testing
  • Replacing configuration in tests

Isolation Frameworks: MOQ

Building Stubs and Mocks can be a lot of work without an Isolation Framework. MOQ is an isolation framework that allows you to easily build the Fake objects you need for building great tests.

  • Understanding Isolation Frameworks
  • Building Stubs and Mocks with MOQ
  • Checking arguments and return values
  • Using Linq to Mocks
  • LAB: Using MOQ

Writing solid, maintainable code that works. This is what every developer wants. This course guides you into the art of unit testing. You will learn how to build testable code. You will become familiar with various techniques and frameworks to give your code a good spin. At the end of this course you will go home with a solid and practical understanding of unit testing and how to apply this in real life. U2U is known for its real-life approach to training, so each chapter is accompanied with lots of hands-on labs.

This course is intended for experienced C# developers.

Contact Us
  • Address:
    U2U nv/sa
    Z.1. Researchpark 110
    1731 Zellik (Brussels)
    BELGIUM
  • Phone: +32 2 466 00 16
  • Email: info@u2u.be
  • Monday - Friday: 9:00 - 17:00
    Saturday - Sunday: Closed
Say Hi
© 2024 U2U All rights reserved.