Index

As this ebook edition doesn't have fixed pagination, the page numbers below are hyperlinked for reference only, based on the printed edition of this book.

Symbols

.NET 277

A

acceptance tests

about 122

example 122

Active Server Pages (ASP) 286

Act stage 22, 156

ADO.NET class 198

aggregate root 188

aggregates 188

Agile Kanban 145

Agile Scrum 145

Agile XP (Extreme Programming) 145

Amazon Web Services (AWS) 41

anemic model 189

Angular Web Framework 152

anti-pattern 190

application

monolith application 182

single microservice 182

working with 182

application programming interface (API) 32, 100

application project 183

application services 183, 194

appointment booking application

about 208-210

booking mobile app 204

booking website 204

back office website 204

business goals 205

business requirements, collecting 204

stories and mockups 205-207, 211, 212

Arrange stage 155

Arrange-Act-Assert (AAA) pattern

about 22, 83, 84, 155

VS code snippets, using 84, 85

Arrange stage 22

ASP.NET controller 194

ASP.NET Core 152

assert class

about 88

methods 88

Record class 89

Assert stage 22

Autofac 55

AutoFixture 324, 325

automated testing 122

automation guideline

about 172

CI automation 172

high performance, on CI 173

B

blog application

in Visual Studio (VS) 182

builder design pattern 159

built-in test tools

about 15

using, via CLI 16, 17

using, via GUI 15, 16

bUnit 216, 246

business challenges 308

business domain 185

business requirements

collecting 204

C

challenges, analyzing

code modification challenges 286, 287

dependency injection support 286

time and effort challenges 286, 288

classic-school TDD 144

class library project

creating, via CLI 11

creating, via GUI 9, 10

class under test (CUT) 85

code coverage

about 166

measurement tools 166-168

unit test coverage spectrum 168-170

code snippets 84

code structure

analyzing, for testable format 298, 299

changing 297, 298

final testable code 299-301

planning 221

code under test (CUT) 17

coding tasks, TDD

about 129, 130

alphanumeric and underscores, ensuring 137-140

min and max lengths, validating 135, 136

null username, validating 129, 130

username already in use, checking 140

command-line interface (CLI) 8, 277

component test 120

concrete (hard) dependency 41

confusing unit 120

continuous deployment (CD) system 272

Continuous Integration (CI) process

about 166, 270, 304

failed tests, simulating 281, 282

implementing, with GitHub Actions 273

sample project, creating in GitHub repository 273-275

tests 280, 281

workflow 271-283

workflow, creating 275-280

Continuous Integration (CI) systems, benefits

about 272

code, compiling 272

code, compiling in ready state for CD 273

unit tests, passing 272

contract objects project 183, 184

contracts 183, 221, 245

cost, time, and quality triangle 170

CUnit 75

D

Dapper

about 196

using, with DI 198, 199

using, with SQL Server 196-199

data transfer objects (DTOs) 40, 298

dependency

about 38-40

best practices 46, 47

concrete type 39

configuration dependency 41

direct instantiation 45, 46

logging dependency 41

OpenWeather client dependency 42

randomness dependency 42

relevance 40

time dependency 42

WeatherForecast class dependency 42

dependency injection (DI)

about 47, 217

API, testing 49-52

DateTime, injecting 61-63

example 48

inversion of control (IoC) 52

lifelike scenario 64, 65

OpenWeather client, injecting 59, 60

random generator, injecting 63, 64

refactoring for 58, 59

seams 52

dependency injection (DI) support

about 286

framework support 286

refactoring for 287

dependency inversion principle (DIP)

about 96

and unit testing 96

example 96

Deterministic guideline

about 176

freezing time, example 176, 177

non-deterministic cases 176

DI containers

role 54, 55

service lifetime 56

third-party containers 55, 56

using 53, 54

division-by-zero test 24, 25

domain

about 185

exploring 185

Domain-Driven Design (DDD)

about 130

architectural view 201, 202

designing with 212

domain objects 213

domain services 214

Solution Explorer view 200, 201

system architecture 214, 21

domain layer project 184

domain object

about 186

entities 187

issues, listing 195

value objects 187

domain project

containers, designing 250

setting up 224, 225, 249

domain services

about 191

implementing, to manage post 191

responsibilities 191

E

EF in-memory provider

configuring 230

sample test data, adding with builder pattern 230, 231

using 228, 229

entities

about 187, 188

versus value objects 188

Entity Framework (EF)

about 186, 190, 199

context class, adding 226

seed data, adding 227

wiring up 225, 226

wiring up, with WebApi project 227

extremes

testing 26-28

F

FakeItEasy 112

fakes 112, 113, 228

fifth story (time management) implementation, WebApi

about 236, 259

records, checking 237, 238, 260

scenario 238, 239

scenario’s complexity, elevating 239, 240, 262, 263

scenario, starting with 261, 262

Fine Code Coverage (FCC) 164

First guideline

about 152

behavior testing, promoting 153

client’s perspective, designing 153

DI ready 152

false positive, eliminating 153

speculative code, eradication 154

unit testing 152

first story implementation, WebApi

about 232, 233, 255, 256

first unit test, adding via TDD 233-235, 256-258

second unit test, adding via TDD 235, 236, 258, 259

Fluent Assertions 322, 324

fluent implementation 322

functional testing 122

G

Gang of Four (GoF) design pattern 159

GitHub Actions

used, for implementing CI process 273

GitHub repository

sample project, creating 273, 275

graphical user interface (GUI) 8, 34

H

happy path 19

headless blog 183

Hibernate (Java) 186

High-Performance guideline

about 171

CPU-intensive unit tests 172

integration tests, calling as unit tests 171

memory-intensive unit tests 172

multiple tests 172

HttpClient 330

HyperText Transfer Protocol (HTTP) 41, 100

I

identifier (ID) 188

implementation routes, appointment booking application

about 215

document DB backend 217

frontend 216

Mediator pattern, using 217

relational database backend 217

infrastructure services 194

integrated development environment (IDE)

.NET and C# versions 7

JetBrains Rider 6

Microsoft VS 4

selecting 4

VS Code 6

integration testing

about 115

example 115-118

versus unit testing 118

integration tests

about 120

versus unit tests, advantages 119

Intention guideline

about 154

Method_Condition_Expectation 154

Method_Should_When 155

unit test structure 155

interface

creating, for class 293

interface segregation principle (ISP)

and unit testing 95, 96

example 95

inversion of control (IoC) 52

isolation 113

J

JavaScript Object Notation (JSON) 42

JetBrains ReSharper

features 5

reference link 6

JetBrains Rider 6

JUnit 75

JustMock Lite 113

JustMock test isolation framework 290

L

Liskov substitution principle (LSP)

about 94

and unit testing 95

example 94, 95

London-school TDD 144

M

Mediator pattern

using 217

Method_Condition_Expectation 154

Method_Should_When 155

method signature

abstracted parameters 43-45

method under test (MUT) 85

Microsoft ASP.NET Core 152

Microsoft Fakes 113

Microsoft MAUI 152

Microsoft VS

about 4

download link 4

installation dialog 5

ReSharper 5

min and max lengths validation

about 135, 136

green stage 136

red stage 136

refactoring stage 137

minimum viable product (MVP) 212

mocking libraries

about 320

Moq 108, 320, 321

NSubstitute 108

mocks

about 108, 111, 228

spies 110

usage, cons 111

usage, example 108, 109

usage, pros 111

versus stubs 111

Model View View-Model (MVVM) 246

Moq

about 108, 320, 321

code, versus NSubstitute code 322

MSTest

about 75, 314

adding, via dotnet CLI 315

MSTest project

adding, into solution 314

N

No Interdependency 88, 112

No Interdependency guidelines

about 173

developer’s responsibility 174, 175

unit testing framework responsibility 174

NSubstitute

about 108

versus Moq code 322

NuGet 197

null username validation

expectation, deciding 131

null check logic, writing 134

production code class shell, creating 131-133

production code method shell, creating 133, 134

refactoring 134, 135

test class, naming 130

test, making to fail 131

unit test method, naming 131

NUnit 75, 314, 317

NUnit project

adding, into solution 317

adding, via dotnet CLI 317, 318

O

object-oriented programming (OOP) 43

object-relational mappers (ORMs) 186, 199

OneCall 36

One Call API 327

on-premise CI servers

examples 270

open-closed principle (OCP)

about 92

and unit testing 93

example 92, 93

Open Weather client library

about 327

implementation, starting with TDD 329-332

mocking scenarios, investigating 334

One Call API 327, 328

production code, creating 332, 333

solution skeleton, creating 328

operating system (OS) 42

outside-in testing 147

P

positive path 19

post management

about 191

post service, adding 191, 192

title service, updating 193, 194

production code 17

project

creating 222-224, 247, 248

dependencies, configuring 223, 224, 247, 248

repository pattern, exploring 250

structure, analyzing 245-247

structure, planning 245-247

project skeleton, creating

about 8

class library project, creating 8, 10

final solution 14

project structure

analyzing 221, 222

planning 221

R

Readability guideline

about 156

builder design pattern 159-161

SUT constructor initialization 156-159

real weather forecaster

adding 33

API key, obtaining 33, 34

client NuGet package, obtaining 34

C to F conversion API 37, 38

random weather API 35

real weather API 36, 37

temperature, mapping 34

Red, Green, Refactor (RGR) 126, 127

regression testing 309

release pipeline 270

repositories

about 196

Entity Framework (EF) 199

example 196

exploring 196

repositories, example

Dapper, using with DI 198, 199

Dapper, using with SQL Server 196-199

DBs, using 199

repository pattern

about 250, 251

and unit testing 251

implementing 252

seed data, adding 254

repository pattern framework

utilizing 253, 254

REpresentational State Transfer (REST) 33

RESTful client library 327

RESTful request 194

S

scoped lifetime 57

seams 52

Selenium 122

service characteristics

domain objects, using 195, 196

stateless services 194

ubiquitous language, using 194

service lifetime

container workflow 58

scoped lifetime 57

selecting 57

singleton lifetime 56

transient lifetime 56

services

application services 194

exploring 190

infrastructure services 194

shim 113

Shouldly

URL 155

Single-Behavior guideline

about 161, 164

behavior, defining 161, 162

behavior, example 162, 163

external behavior, testing 163, 164

testing 165

single page application (SPA) 216

single-responsibility principle (SRP)

and unit testing 91

benefits 90

example 91

singleton lifetime 56

Sintegration test

challenges 148

using, as an alternative to unit testing with TDD 147, 148

using, with TDD 146

Sintegration testing

about 120

example 121, 122

software development kit (SDK) 327

software development life cycle (SDLC) 309

SOLID principles

applying 90

dependency inversion principle (DIP) 96

interface segregation principle (ISP) 95

Liskov substitution principle (LSP) 94

single-responsibility principle (SRP) 90

solution skeleton, building with unit testing

about 7

built-in test tools 15

project skeleton, creating 8

requirement 8

spies 106, 107

StackOverflow 196

static members replacement295

static property 62

struct 187

StructureMap 55

stubs

about 101-105, 107

spies 106, 107

usage, cons 107

usage, pros 107

versus mocks 111

system testing 122

system under test (SUT) 17, 18, 85, 86, 100, 153

T

TDD, enabling

code, changing 290, 291

native support, for DI 291

rewriting, considering 289, 290

test coverage 291, 292

TDD pillars

about 126

RGR 126

test first 126

team challenges

about 305, 306

team experience 306

timing 307

Team Foundation Server (TFS) 270

Telerik JustMock 113

test categories

selecting 122

test double

about 75, 100

using 100

test double, types

dummies 100, 101

fakes 112, 113

isolation 113

mocks 108

stubs 101-107

Test-Driven Development (TDD)

about 100, 114

AAA pattern 22

and Agile XP relationship 145

arguments and misconceptions 311, 312

business benefits 308, 309

business disadvantages 309-311

coding tasks, adding 129

conditions and expectations 19

demonstrating, with examples 127, 128

limitation 143, 144

need for 141

Open Weather client library, implementing with 329-332

pillars 126

red/green tests 21, 22

requirements, implementing with 17

software requisites 142

solution shell, creating 128, 129

strategy, for enabling 288, 289

SUT 17

testing class 18

using, with Sintegration tests 146

versus no testing concerning time and features 142, 143

versus unit testing 307

WebApis, implementing with 228, 255

Test Explorer 15, 79

testing triangle 122

test isolation framework 290

test projects

about 76

naming convention 77

sample unit test, running 77, 78

Test Explorer 79

xUnit, adding via CLI 76, 77

Thoroughness guideline

about 165

code coverage 166

thorough, defining 170

unit tests, for dependency testing 165

transient lifetime 56

triggered dependencies 117

T-SQL query 198

two indivisible numbers

dividing 23, 24

U

ubiquitous language

about 190

advantages 190

Unicorn Quality Solutions (UQS) 204

Unified Modeling Language (UML) 38

Unit 306

unit test class

anatomy 79

Arrange-Act-Assert pattern 83

methods 80

methods, examples 80-83

methods, naming convention 83

naming convention 80

system under test (SUT) 85

unit test coverage spectrum 168, 170

unit testing

about 74

and interface segregation principle (ISP) 95, 96

and Liskov substitution principle (LSP) 95

and open-closed principle (OCP) 93

and single-responsibility principle (SRP) 91, 92

dependency inversion principle (DIP) 96

drawbacks 145

frameworks 75

limitation 307

refactoring for 292

SOLID principles, applying 90

solution skeleton, building with 7

versus integration testing 118

unit testing class

about 18, 19

method name 19

name 19

unit testing frameworks

about 314

MSTest 75, 314-317

NUnit 75, 317-319

xUnit 75

unit testing helper libraries

about 322

AutoFixture 324, 325

Fluent Assertions 322, 324

unit testing project

creating, via CLI 13

creating, via GUI 12, 13

unit testing, refactoring

code structure, changing 297, 298

static members replacement 295-297

variables instantiated 292

unit tests

about 240

code documentation via 145

versus integration tests, advantages 119

unit test structure

about 155

Act 156

Arrange 155

Assert 156

user interface (UI) 52

V

value objects

about 187

example, £5 note 187

versus entities 188

variables instantiated scenario

components, injecting 294, 295

creating, for third-party class 293, 294

view models 183

Visual Basic 6 (VB6) 286

Visual Studio Code

about 6, 279

download link 7

Visual Studio (VS) 314

W

Weather Forecasting App (WFA)

about 30, 162

real weather forecaster, adding 33

sample weather forecaster, creating 30-32

WebApi

implementing, with TDD 255

WebApi project

about 221

EF, wiring up 227

WebApis, implementing with TDD

about 228

EF in-memory provider, using 228, 229

fifth story (time management), implementing 236

first story, implementing 232, 233

WebAssembly (Wasm) 216

website project

setting up 228, 254

workflow

about 283

creating 275-280

wrapper class 293

X

xUnit

about 75

adding, via CLI 76, 77

assert class 88, 89

basics 86

Fact attribute 86

running 87, 88

Theory attribute 86

Y

YAML 275

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.154.185