Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Pragmatic Test-Driven Development in C# and .NET
Pragmatic Test-Driven Development in C# and .NET

Pragmatic Test-Driven Development in C# and .NET: Write loosely coupled, documented, and high-quality code with DDD using familiar tools and libraries

eBook
€22.99 €25.99
Paperback
€31.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Pragmatic Test-Driven Development in C# and .NET

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Build a full TDD-based app employing familiar tools and libraries to practice real-world scenarios
  • Derive your architecture using TDD with domain-driven design and SOLID approach
  • Know the challenges of rolling out TDD and unit testing into your organization and build a plan

Description

Test-driven development is a manifesto for incrementally adding features to a product but starting with the unit tests first. Today’s project templates come with unit tests by default and implementing them has become an expectation. It’s no surprise that TDD/unit tests feature in most job specifications and are important ingredients for most interviews and coding challenges. Adopting TDD will enforce good design practices and expedite your journey toward becoming a better coding architect. This book goes beyond the theoretical debates and focuses on familiarizing you with TDD in a real-world setting by using popular frameworks such as ASP.NET Core and Entity Framework. The book starts with the foundational elements before showing you how to use Visual Studio 2022 to build an appointment booking web application. To mimic real-life, you’ll be using EF, SQL Server, and Cosmos, and utilize patterns including repository, service, and builder. This book will also familiarize you with domain-driven design (DDD) and other software best practices, including SOLID and FIRSTHAND. By the end of this TDD book, you’ll have become confident enough to champion a TDD implementation. You’ll also be equipped with a business and technical case for rolling out TDD or unit testing to present to your management and colleagues.

Who is this book for?

This book is for mid to senior-level .NET developers looking to use the potential of TDD to develop high-quality software. Basic knowledge of OOP and C# programming concepts is assumed but no knowledge of TDD or unit testing is expected. The book provides in-depth coverage of all the concepts of TDD and unit testing, making it an excellent guide for developers who want to build a TDD-based application from scratch or planning to introduce unit testing into their organization.

What you will learn

  • Writing unit tests with xUnit and getting to grips with dependency injection
  • Implementing test doubles and mocking with NSubstitute
  • Using the TDD style for unit testing in conjunction with DDD and best practices
  • Mixing TDD with the ASP.NET API, Entity Framework, and databases
  • Moving to the next level by exploring continuous integration with GitHub
  • Getting introduced to advanced mocking scenarios
  • Championing your team and company for introducing TDD and unit testing

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Sep 30, 2022
Length: 372 pages
Edition : 1st
Language : English
ISBN-13 : 9781803231303
Languages :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Sep 30, 2022
Length: 372 pages
Edition : 1st
Language : English
ISBN-13 : 9781803231303
Languages :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 105.97
Pragmatic Test-Driven Development in C# and .NET
€31.99
Real-World Implementation of C# Design Patterns
€35.99
C# 11 and .NET 7 – Modern Cross-Platform Development Fundamentals
€37.99
Total 105.97 Stars icon

Table of Contents

18 Chapters
Part 1: Getting Started and the Basics of TDD Chevron down icon Chevron up icon
Chapter 1: Writing Your First TDD Implementation Chevron down icon Chevron up icon
Chapter 2: Understanding Dependency Injection by Example Chevron down icon Chevron up icon
Chapter 3: Getting Started with Unit Testing Chevron down icon Chevron up icon
Chapter 4: Real Unit Testing with Test Doubles Chevron down icon Chevron up icon
Chapter 5: Test-Driven Development Explained Chevron down icon Chevron up icon
Chapter 6: The FIRSTHAND Guidelines of TDD Chevron down icon Chevron up icon
Part 2: Building an Application with TDD Chevron down icon Chevron up icon
Chapter 7: A Pragmatic View of Domain-Driven Design Chevron down icon Chevron up icon
Chapter 8: Designing an Appointment Booking App Chevron down icon Chevron up icon
Chapter 9: Building an Appointment Booking App with Entity Framework and Relational DB Chevron down icon Chevron up icon
Chapter 10: Building an App with Repositories and Document DB Chevron down icon Chevron up icon
Part 3: Applying TDD to Your Projects Chevron down icon Chevron up icon
Chapter 11: Implementing Continuous Integration with GitHub Actions Chevron down icon Chevron up icon
Chapter 12: Dealing with Brownfield Projects Chevron down icon Chevron up icon
Chapter 13: The Intricacies of Rolling Out TDD Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.6
(7 Ratings)
5 star 85.7%
4 star 0%
3 star 0%
2 star 14.3%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




N/A Oct 03, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Pragmatic Test-Driven Development in C# and .NET is an outstanding book that introduces TDD (Test-Driven Development) practices in a clear and pragmatic way. The authors seamlessly blend theory with practical examples, making the book not only a theoretical guide but also a great tool for applying TDD in everyday C# and .NET projects. One of the book's key strengths is that it explains TDD step by step, from the basics, which makes it ideal both for beginners and those looking to solidify their knowledge. The authors present real-world problems and show how to approach solving them by writing tests first, then implementing the production code. Combined with rich examples and explanations of refactoring techniques, the reader gains comprehensive tools for creating solid, testable software. The book is well-organized, with a clear breakdown of TDD implementation stages, and it demonstrates how TDD can be integrated into the full software development lifecycle within the .NET ecosystem. This makes it a valuable resource for developers aiming to enhance the quality of their code while maintaining agility in project work. I highly recommend this book to anyone wanting to master unit testing and TDD in the .NET environment. It’s an investment that will undoubtedly improve the quality of your code and the effectiveness of your programming process.
Feefo Verified review Feefo
J Oct 08, 2022
Full star icon Full star icon Full star icon Full star icon Full star icon 5
TL;DR: if you're a serious .Net developer and you work on a big project (or you want to) - you must have this book.I'm a software developer with 20 years of experience across different bisuiness areas. The one thing I learned hard way is that a cost of a small mistake can be enormous (or even disasterous) for a company. Especially if it's a financial company. Let's be honest, developers and managers don't like wriging tests. They take time and don't add functionality. Why would you want to spend time writing tests if you can add a number of cool features especially if the project is running late? However, with time the projects are getting bigger and bigger. People come and go. Nobody remembers / knows what happens in all branches of the code. And the only thing that can save the code in this case - unit tests. They are a like a techincal documentation that magically can shows if something is broken when you make a change.The book gives a very detailed and comprehensive overview of best practices with unit tests. It's easy to read and it has a lot of examples. Clearly, the author has a lot of experience in the area that he shares with the audience in this book. No matter what your current level is - you'll definitelly find something useful and new in this book.
Amazon Verified review Amazon
Ramikaze Oct 03, 2022
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Been grappling with many projects for the company for a while now, well honestly ever since I can remember deploying programming amongst my company's dedicated team. The book is great and serves its purpose. Would have preferred hardback, but that's just a personal preference.
Amazon Verified review Amazon
Tiny Nov 30, 2022
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Creating quality code at an accelerated pace means testing correctly at every step of the process, and testing does not happen effectively unless you create a useful plan. “Pragmatic Test-Driven Development in C# and .net” (@Packt) by Adam Tibi delivers a comprehensive look into making a plan and writing quality code to meet those goals. Test-Driven Development (TDD) has long been a pillar of Agile, Agile XP, and other accelerated development methods. This book adds a connection to Domain Driven Development(DDD) as a business-oriented approach to converting user requirements into a useful test model. The first section offers an overview of comprehensive basics, the second details building an app using TDD, and the third references some advanced concepts. Overall, a great learning tool for experienced developers looking to take their processes to the next level. One of the joys of an advanced book like this appears in the author’s assumption that anyone reading already knows C# and .net to a high level. The basics start with correctly formatting an IDE for test. The author uses VS code and explains testing formats. The three formats are System Under Test (SUT), red-green tests, and Arrange-Act-Assert (AAA). The AAA method is the most directly applicable to coding and involves commenting on different sections so the code can be read easily by others. This concept moves into explaining the Dependency Injection (DI) pattern when used with the software. A weather-forecasting app is used as a sample to create an initial local instance and then reach out to real-time updates to model dependencies at multiple levels. Another plus, the work ties into the well-known SOLID architecture principles to demonstrate how tests reflect these options and ensure quality code at every level. Samples are provided for dummy, stub, mock and fake instances as examples of creating code that can enable compiling, eliminate side effects, embed canned actions, or verify where activities occur. At the end of the section, the author provides his own reference, FIRSTHAND, as an acronym for unit testing based on First, Intention, Readability, Single-behavior, Thoroughness, High-performance, Automation, No interdependency, and Deterministic. This is integrated with two models, test first and Red-Green-Refactor (RGR). RGR details writing a requirement to fail the test with no code, writing the code to pass and then refactoring to effective code. It also offers a perspective on what the author calls, “Sintegration” using some components from unit testing with artificial data and some with integration testing using the actual code. The middle section details a comprehensive coding example to build an appointment-building application that starts from requirements and builds through integration with multiple databases. Tests are shown and explained for every step. Along the way, the author suggests the pros and cons for the different strategies as well as some referencing some frequently asked questions.
Amazon Verified review Amazon
POE Dec 29, 2022
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book is relevant and useful for C# and .NET developers that want to learn proven software development best practices to include domain-driven design (DDD), test-driven design (TDD), and unit testing. The book is written for developers already familiar with C# and .NET. The best practices taught in this book are not specific to a C# or .NET version, so this book is apt to be relevant for many years.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.