Skip to Content
C# and .NET Core Test-Driven Development
book

C# and .NET Core Test-Driven Development

by Ayobami Adewole
May 2018
Intermediate to advanced content levelIntermediate to advanced
300 pages
7h 35m
English
Packt Publishing
Content preview from C# and .NET Core Test-Driven Development

Easy to set up, non-trivial, and with good coverage

Unit tests should be easy to set up and decoupled from any direct or external dependencies. The external dependencies should be mocked using a suitable mocking framework. Appropriate object setup should be done in setup methods or test class constructors.

Avoid redundant codes that can clog the tests and ensure the tests contain only codes that are relevant to the methods being tested. Also, tests should be written for units or methods. For example, writing tests for class getters and setters might be considered too trivial.

Lastly, good unit tests should have good code coverage. All execution paths in a method under test should be covered and all the tests should have defined criteria that ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On Design Patterns with C# and .NET Core

Hands-On Design Patterns with C# and .NET Core

Gaurav Aroraa, Jeffrey Chilberto
.NET Core in Action

.NET Core in Action

Dustin Metzgar

Publisher Resources

ISBN: 9781788292481Supplemental Content