Cargando…

C# and .NET Core Test-Driven Development : Dive into TDD to create flexible, maintainable, and production-ready .NET Core applications.

With constantly changing business requirements and technical environments, the code needs to evolve too. Building applications using test-driven development process ensures that they work properly irrespective of such changes. In this book, you will learn to make such robust and production-ready app...

Descripción completa

Detalles Bibliográficos
Clasificación:Libro Electrónico
Autor principal: Adewole, Ayobami
Formato: Electrónico eBook
Idioma:Inglés
Publicado: Birmingham : Packt Publishing, 2018.
Temas:
Acceso en línea:Texto completo
Tabla de Contenidos:
  • Cover; Copyright and Credits; Dedication; Packt Upsell; Contributors; Table of Contents; Preface; Chapter 1: Exploring Test-Driven Development; Difficulty in maintaining code; How does bad code appear? ; Tight coupling; Code smell; Bad or broken designs; Naming the program elements; Source code readability; Poor source code documentation; Non-tested code; What we can do to prevent bad code; Loose coupling; Sound architecture and design; Preventing and detecting code smell; C# coding conventions; Succinct and proper documentation; Why test-driven development?; Building for longevity.
  • The principles of test-driven developmentOrigin of TDD; TDD misconceptions; Benefits of TDD; Types of tests; Unit tests; Integration tests; System testing; User acceptance testing; Principles of TDD; Writing the tests; Writing the code; Running the tests; Refactoring; Doing TDD the wrong way; The TDD cycle; Summary; Chapter 2: Getting Started with .NET Core; .NET Core framework; .NET Standard; .NET Core components; Supported languages; When to choose .NET Core over .NET Framework; Cross-platform requirements; Ease of deployment; Scalability and performance; Limitations of .NET Core.
  • Structure of a .NET Core applicationASP.NET Core MVC project structure; wwwroot folder; Models, Views, and Controllers folders; JSON files
  • bower.json, appsettings.json, bundleconfig.json; Program.cs; Startup.cs; Tour of Microsoft's Visual Studio Code editor; Installing .NET Core on Linux; Installing and setting up Visual Studio Code on Linux; Exploring Visual Studio Code; A look at the new features of C# 7; Tuples enhancement; Out keyword; Ref locals and returns; Ref locals; Ref returns; Local function; Patterns matching; Digit separator and binary literal.
  • Creating an ASP.NET MVC Core applicationSummary; Chapter 3: Writing Testable Code; Warning signs when writing untestable code; Tight coupling; Monster Constructor; Classes with more than one responsibility; Static objects; Law of Demeter; Train Wreck; The SOLID architecture principles; Single Responsibility Principle; Open-Closed Principle ; Liskov Substitution Principle; Interface Segregation Principle; Dependency Inversion Principle; Setting up a DI container for ASP.NET Core MVC; Summary; Chapter 4: .NET Core Unit Testing; The attributes of a good unit test; Readable; Unit independence.
  • RepeatableMaintainable and runs fast; Easy to set up, non-trivial, and with good coverage; Unit testing framework ecosystem for .NET Core and C#; .NET Core testing with MSTest; .NET Core testing with NUnit; xUnit.net; How to configure xUnit.net; xUnit.net test runners; Test parallelism; Unit testing consideration for ASP.NET MVC Core; Unit testing controllers; Unit testing razor pages; Structuring unit tests with xUnit; xUnit.net shared test context; Live unit testing with Visual Studio 2017 Enterprise; Proving unit test results with xUnit.net assertions.