liveBook · Manning

Unit test

A unit test is a test that evaluates the behavior of a small, isolated unit of software against expected behavior.

How 9 Manning books explain it

Pro ASP.NET Core 7, Tenth Edition

A unit test is an automated test that checks a small, isolated part of an application such as an individual method or class.

How it is used
Checks isolated ASP.NET Core component behavior, from model properties to controller actions and tag-helper output.
How deep it goes
Works through project setup, assertions, runners, dependency isolation, and application tests; defers detailed explanation of ViewResult.
Examples
Uses product-property checks, controller view models, generated page links, category counts, and checkout decisions.
What you can do after
Apply it via xUnit and Moq to run isolated tests and check controller results and dependency calls.

Read how Pro ASP.NET Core 7, Tenth Edition explains unit test →

Shipping Go: Develop, deliver, discuss, design, and go again

Unit testing evaluates individual units of code independently and focuses on a small portion of a program.

How it is used
Provides fast, automated validation of small code units and documents expected business behavior during development.
How deep it goes
Works through selecting cases, asserting results, repairing failures, and refactoring; distinguishes unit tests from broader tests without developing full end-to-end testing.
Examples
Tests a Go translation function for supported languages, unsupported input, capitalization, and whitespace; also suggests deterministic balance and error-rate calculations.
What you can do after
Build it from scratch: write Go function tests, use failures to correct behavior, and automate the checks before broader testing.

Read how Shipping Go: Develop, deliver, discuss, design, and go again explains unit test →

BDD in Action, Second Edition

Unit testing is the evaluation of individual software components in isolation from the rest of the application.

How it is used
Uses unit tests to specify component behavior during outside-in feature implementation and to pinpoint code affected by changing requirements.
How deep it goes
Defines unit tests against acceptance tests and works through test-driven implementation and change; does not require one particular testing tool.
Examples
Shows a bank account’s initial-balance assertion and a journey planner test updated to expect four departures.
What you can do after
Apply it via JUnit 5 to specify component behavior and leave readable technical documentation for maintainers.

Read how BDD in Action, Second Edition explains unit test →

Rust Servers, Services, and Apps

A unit test is an automated test that checks the behavior of a small, isolated program component.

How it is used
Checks Rust web-service handlers and HTTP data-processing functions while building and testing application iterations.
How deep it goes
Works through test setup, direct invocation, and assertions; contrasts direct handler tests with integration tests but does not develop database logic in the interim example.
Examples
Uses course API handlers, tutor form submissions, HTTP request parsing, and response status and serialization assertions.
What you can do after
Evaluate handler behavior by invoking functions directly and asserting responses, or test HTTP parsing and response formatting with Cargo.

Read how Rust Servers, Services, and Apps explains unit test →

Practical Automation with PowerShell: Effective scripting from the console to the cloud

A unit test is a software test that verifies the behavior of a small, isolated unit of code.

How it is used
Uses repeatable Pester checks to protect PowerShell function logic as automation changes.
How deep it goes
Explains Pester structure, setup scope, mocks, assertions, and the unit-versus-integration boundary through complete scenarios.
Examples
Demonstrates patch-status checks and KB supersedence parsing with mocked cmdlets, web responses, HTML fixtures, GUIDs, products, and architectures.
What you can do after
Apply it via Pester to isolate PowerShell functions, control dependencies with mocks, and validate expected results.

Read how Practical Automation with PowerShell: Effective scripting from the console to the cloud explains unit test →

gRPC Microservices in Go

A unit test verifies the behavior of an isolated unit of software, often across defined execution scenarios.

How it is used
Checks Order service scenarios quickly without running its dependent services.
How deep it goes
Works through interface mocks and success and failure assertions; leaves real database interaction to integration tests.
Examples
Uses Go PlaceOrder tests for successful placement, database persistence failure, and payment validation errors.
What you can do after
Build it from scratch for an Order service operation using mocked dependencies, then run tests and generate coverage.

Read how gRPC Microservices in Go explains unit test →

The Creative Programmer

A unit test is an automated test that verifies the behavior of a small, isolated unit of software.

How it is used
Uses focused executable checks to verify assumptions, protect changes, and build confidence in difficult codebases.
How deep it goes
Explains the verification purpose and readable assertion pattern, but stops short of detailed test design or framework instruction.
Examples
Shows PL/SQL testing, a VB6 SimplyVBUnit suite, and a readable assertion expecting 45 from a method call.
What you can do after
Diagnose/debug with it by checking behavior, exposing false assumptions, and increasing confidence before committing changes.

Read how The Creative Programmer explains unit test →

Google Anthos in Action

Unit testing is the practice of testing an isolated software unit, such as a function, class, or module, against expected behavior.

How it is used
Uses automated checks in continuous integration to accelerate legacy-application modernization and provide developers with rapid feedback.
How deep it goes
Defines isolated testing and its CI role, but stops short of detailing test design, execution mechanics, or assertion strategies.
Examples
Tests a decoupled business-domain service in isolation as part of an application build pipeline.
What you can do after
Apply unit tests through continuous integration to identify and fix application problems faster.

Read how Google Anthos in Action explains unit test →

Essential TypeScript 5, Third Edition

A unit test is an automated test that evaluates a small, isolated unit of program behavior.

How it is used
Confirms that application code behaves as expected, especially for features and functions likely to contain deployment bugs.
How deep it goes
Explains setup, file conventions, assertions, watch execution, and failure correction, but stops short of teaching unit-testing theory.
Examples
Uses a calc.test.ts file to test sum, Jest matchers, watch output, and deliberate implementation and expectation changes.
What you can do after
Apply it via Jest to write, execute, monitor, and diagnose focused tests for TypeScript application behavior.

Read how Essential TypeScript 5, Third Edition explains unit test →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.