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
All 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

Arrow left icon
Profile Icon Adam Tibi
Arrow right icon
£9.99 per month
Full star icon Full star icon Full star icon Full star icon Half star icon 4.6 (7 Ratings)
Paperback Sep 2022 372 pages 1st Edition
eBook
£25.99
Paperback
£31.99
Subscription
Free Trial
Renews at £9.99p/m
Arrow left icon
Profile Icon Adam Tibi
Arrow right icon
£9.99 per month
Full star icon Full star icon Full star icon Full star icon Half star icon 4.6 (7 Ratings)
Paperback Sep 2022 372 pages 1st Edition
eBook
£25.99
Paperback
£31.99
Subscription
Free Trial
Renews at £9.99p/m
eBook
£25.99
Paperback
£31.99
Subscription
Free Trial
Renews at £9.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. £13.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

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 : 9781803230191
Languages :
Tools :

What do you get with a Packt Subscription?

Free for first 7 days. £13.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

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

Packt Subscriptions

See our plans and pricing
Modal Close icon
£9.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 6,500+ 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
£99.99 billed annually
Feature tick icon Unlimited access to Packt's library of 6,500+ 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
£139.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 6,500+ 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
Visually different images

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
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
Rohan Nov 30, 2022
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book provides a thorough look at creating a plan and producing high-quality code to achieve those goals. Agile, Agile XP, and other rapid development methodologies have long placed a strong emphasis on Test-Driven Development (TDD). The connection to Domain Driven Development(DDD) as a business-oriented method of transforming user requirements into a practical test model is strengthened by this book.
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
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.