test fixture
Fixed, known data or setup that tests use so their results are predictable, such as a sample file, a seeded database or a started application.
In more detail
Fixtures keep tests independent of the outside world, make results reproducible and avoid repeating expensive setup. Testing tools offer different mechanisms for them, from plain data files to setup functions and classes.
Examples
xUnit: IClassFixture<WebApplicationFactory<Program>>func (Fixture) Read() string { return "fixture data" }Go: fixture files conventionally live in a testdata foldertype Fixture struct{} returns fixed data through an interfaceRelated terms
- xUnit.net — A popular open-source unit testing framework for .NET, where [Fact] marks a test method and Assert checks results.
- WebApplicationFactory — An ASP.NET Core testing class that starts your real application in memory and gives tests an HttpClient connected to it.
- test double — Any object that replaces a real dependency in a test: a stub returns canned data, a fake is a small working implementation, and a mock checks interactions.
- deterministic — Always producing the same result from the same inputs, with nothing left to chance or timing.
Taught in
- What An AI Engineer Does — AI Engineering: LLM Apps, RAG & Agents
- Tokens And The Context Window — AI Engineering: LLM Apps, RAG & Agents
- How The Next Token Is Chosen — AI Engineering: LLM Apps, RAG & Agents
- Choosing A Model — AI Engineering: LLM Apps, RAG & Agents
- The Request And The Response — AI Engineering: LLM Apps, RAG & Agents
- Streaming Responses — AI Engineering: LLM Apps, RAG & Agents
- Cost, Latency And Caching — AI Engineering: LLM Apps, RAG & Agents
- Zero-Shot And Few-Shot — AI Engineering: LLM Apps, RAG & Agents
- Prompts As Code — AI Engineering: LLM Apps, RAG & Agents
- From Prompts To Context — AI Engineering: LLM Apps, RAG & Agents
- Memory And Compaction — AI Engineering: LLM Apps, RAG & Agents
- When Context Fails — AI Engineering: LLM Apps, RAG & Agents
- What An Embedding Is — AI Engineering: LLM Apps, RAG & Agents
- Embedding Models — AI Engineering: LLM Apps, RAG & Agents
- Vector Indexes And Databases — AI Engineering: LLM Apps, RAG & Agents
- Keyword And Hybrid Search — AI Engineering: LLM Apps, RAG & Agents
- Measuring Retrieval — AI Engineering: LLM Apps, RAG & Agents
- How RAG Works And When To Use It — AI Engineering: LLM Apps, RAG & Agents
- Chunking And Ingestion — AI Engineering: LLM Apps, RAG & Agents
- Function Calling — AI Engineering: LLM Apps, RAG & Agents
- Designing Tools A Model Can Use — AI Engineering: LLM Apps, RAG & Agents
- Build An MCP Server — AI Engineering: LLM Apps, RAG & Agents
- Remote Servers And Trust — AI Engineering: LLM Apps, RAG & Agents
- Evaluating RAG And Agents — AI Engineering: LLM Apps, RAG & Agents
- Tracing And Monitoring — AI Engineering: LLM Apps, RAG & Agents
- Working With AI Coding Assistants — AI Engineering: LLM Apps, RAG & Agents
- Integration Testing with WebApplicationFactory — Modern .NET Core, C# & Enterprise Microservices
- Interfaces and Why They Are Implicit — Concurrent Systems Programming with Go