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
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
appointment booking application
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
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
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
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
class under test (CUT) 85
code coverage
about 166
unit test coverage spectrum 168-170
code snippets 84
code structure
analyzing, for testable format 298, 299
planning 221
code under test (CUT) 17
coding tasks, TDD
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
failed tests, simulating 281, 282
implementing, with GitHub Actions 273
sample project, creating in GitHub repository 273-275
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
cost, time, and quality triangle 170
CUnit 75
D
Dapper
about 196
using, with SQL Server 196-199
data transfer objects (DTOs) 40, 298
dependency
concrete type 39
configuration dependency 41
logging dependency 41
OpenWeather client dependency 42
randomness dependency 42
relevance 40
time dependency 42
WeatherForecast class dependency 42
dependency injection (DI)
example 48
inversion of control (IoC) 52
OpenWeather client, injecting 59, 60
random generator, injecting 63, 64
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
service lifetime 56
domain
about 185
exploring 185
Domain-Driven Design (DDD)
about 130
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
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
entities
versus value objects 188
Entity Framework (EF)
context class, adding 226
seed data, adding 227
wiring up, with WebApi project 227
extremes
F
FakeItEasy 112
fifth story (time management) implementation, WebApi
records, checking 237, 238, 260
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
first unit test, adding via TDD 233-235, 256-258
second unit test, adding via TDD 235, 236, 258, 259
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
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)
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
London-school TDD 144
M
Mediator pattern
using 217
Method_Condition_Expectation 154
Method_Should_When 155
method signature
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
green stage 136
red stage 136
refactoring stage 137
minimum viable product (MVP) 212
mocking libraries
about 320
NSubstitute 108
mocks
spies 110
usage, cons 111
usage, pros 111
versus stubs 111
Model View View-Model (MVVM) 246
Moq
code, versus NSubstitute code 322
MSTest
adding, via dotnet CLI 315
MSTest project
adding, into solution 314
N
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
test class, naming 130
test, making to fail 131
unit test method, naming 131
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
Open Weather client library
about 327
implementation, starting with TDD 329-332
mocking scenarios, investigating 334
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
title service, updating 193, 194
production code 17
project
dependencies, configuring 223, 224, 247, 248
repository pattern, exploring 250
project skeleton, creating
about 8
class library project, creating 8, 10
final solution 14
project structure
planning 221
R
Readability guideline
about 156
builder design pattern 159-161
SUT constructor initialization 156-159
real weather forecaster
adding 33
client NuGet package, obtaining 34
random weather API 35
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
and unit testing 251
implementing 252
seed data, adding 254
repository pattern framework
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
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
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
StackOverflow 196
static members replacement295
static property 62
struct 187
StructureMap 55
stubs
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
native support, for DI 291
rewriting, considering 289, 290
TDD pillars
about 126
RGR 126
test first 126
team challenges
team experience 306
timing 307
Team Foundation Server (TFS) 270
Telerik JustMock 113
test categories
selecting 122
test double
using 100
test double, types
isolation 113
mocks 108
Test-Driven Development (TDD)
AAA pattern 22
and Agile XP relationship 145
arguments and misconceptions 311, 312
business disadvantages 309-311
coding tasks, adding 129
conditions and expectations 19
demonstrating, with examples 127, 128
need for 141
Open Weather client library, implementing with 329-332
pillars 126
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
testing triangle 122
test isolation framework 290
test projects
about 76
naming convention 77
sample unit test, running 77, 78
Test Explorer 79
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
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, 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
method name 19
name 19
unit testing frameworks
about 314
xUnit 75
unit testing helper libraries
about 322
unit testing project
creating, via CLI 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
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
workflow
about 283
wrapper class 293
X
xUnit
about 75
basics 86
Fact attribute 86
Theory attribute 86
Y
YAML 275
3.145.154.185