Unit test
A unit test is a test that evaluates the behavior of a small, isolated unit of software against expected behavior.
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.
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.
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.
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.
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.
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
- integration testcontrasts with · An integration test evaluates whether multiple software components, or a component and an external dependency, interact and behave correctly together.
- testkind of · A test is a procedure or check that evaluates behavior using specified inputs or evidence against expected results or criteria.
- mockingused by · Mocking is a testing technique that replaces a real dependency with a controlled substitute to simulate behavior or inspect interactions.
- testing pyramidpart of · The testing pyramid is a software-testing model that favors many fast, focused lower-level tests and progressively fewer, broader, slower tests at higher levels.
- test-driven developmentused by · Test-driven development is a software development practice in which tests are written before implementation and guide incremental coding and refactoring.
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.








