C# 7 Test Driven Development

Ayobami Adewole

  • 出版商: Packt Publishing
  • 出版日期: 2018-05-18
  • 售價: $1,710
  • 貴賓價: 9.5$1,625
  • 語言: 英文
  • 頁數: 300
  • 裝訂: Paperback
  • ISBN: 1788292480
  • ISBN-13: 9781788292481
  • 相關分類: C#TDD 測試導向開發
  • 下單後立即進貨 (約3~4週)

買這商品的人也買了...

相關主題

商品描述

Key Features

  • Offers practical advice in creating tests to quickly detect and resolve issues when writing portable code
  • Uncovers code integration issues that improve code quality by using continuous integration
  • Set up and use data-driven unit testing to verify your code over a range on inputs

Book Description

This book enables developers to create robust, production-ready C# 7 and .NET Core applications by establishing a professional test-driven development process. To do this, we will begin by learning the stages of the TDD lifecycle, some best practices, and some anti-patterns.

After covering the basics of TDD in the first chapter, we will get right into creating our ASP.NET Core MVC sample application. We will learn how to write testable code with SOLID principles, and will set up dependency injection for our sample application. Next, we will take a good look at the xUnit testing framework, and learn how to use its attributes and assertions. When we start writing our tests, we will learn what "Fact" vs. "Theory" means in .NET Core unit testing, as well as how to use each. When we get the basic in place, we will learn how to create data-driven unit tests and how to mock dependencies in our code. We will learn the differences between running and debugging our tests on .NET Core on LINUX, versus Windows and Visual Studio. We will wrap up by creating a healthy continuous integration process for our sample application, using GitHub, TeamCity, and Cake. Finally, we will modify the CI build to test, version, and package our sample application.

What you will learn

  • Write flexible, maintainable, verifiable code for .NET Core
  • Learn how to write testable code using SOLID principles and dependency injections
  • Recognize the characteristics of a good unit test
  • How to structure and group your unit test
  • Use mock objects to handle dependencies
  • How to set up a continuous integration process from end-to-end

商品描述(中文翻譯)

主要特點


  • 提供實用建議,以便在撰寫可攜程式碼時快速檢測和解決問題

  • 揭示透過持續整合改善程式碼品質的程式碼整合問題

  • 建立並使用資料驅動的單元測試來驗證程式碼在各種輸入範圍下的正確性

書籍描述

本書幫助開發人員建立專業的測試驅動開發流程,以創建堅固、可投入生產的 C# 7 和 .NET Core 應用程式。為此,我們將首先學習 TDD 生命週期的各個階段、一些最佳實踐和一些反模式。

在第一章介紹了 TDD 的基礎知識後,我們將立即開始創建 ASP.NET Core MVC 的範例應用程式。我們將學習如何使用 SOLID 原則編寫可測試的程式碼,並為範例應用程式設置依賴注入。接下來,我們將詳細介紹 xUnit 測試框架,並學習如何使用其屬性和斷言。當我們開始撰寫測試時,我們將學習在 .NET Core 單元測試中「Fact」與「Theory」的含義,以及如何使用它們。當我們完成基本設置後,我們將學習如何創建資料驅動的單元測試,以及如何模擬程式碼中的依賴關係。我們將了解在 .NET Core 上的 LINUX、Windows 和 Visual Studio 上運行和調試測試的差異。最後,我們將使用 GitHub、TeamCity 和 Cake 創建一個健全的持續整合流程,並修改 CI 构建以測試、版本控制和打包我們的範例應用程式。

你將學到什麼


  • 為 .NET Core 撰寫靈活、易維護、可驗證的程式碼

  • 學習使用 SOLID 原則和依賴注入來撰寫可測試的程式碼

  • 識別良好單元測試的特點

  • 如何結構化和分組單元測試

  • 使用模擬物件處理依賴關係

  • 如何從頭到尾設置持續整合流程