# Integration Testing (.NET) > WebApplicationFactory, TestServer, database testing, HTTP client testing, test fixtures - 18 interview questions - Mid-Level - [Interview Questions: .NET](https://sharpskill.dev/en/technologies/dotnet/interview-questions.md) ## 1. What is WebApplicationFactory in ASP.NET Core? **Answer** WebApplicationFactory is a class provided by the Microsoft.AspNetCore.Mvc.Testing package that allows creating an in-memory test server for integration testing. It initializes the ASP.NET Core application with all its dependencies without requiring actual deployment, making tests fast and isolated. This approach is recommended because it tests the application in an environment close to production while avoiding the setup costs of a real server. ## 2. What is the main advantage of using WebApplicationFactory instead of a real HTTP server in integration tests? **Answer** WebApplicationFactory creates an in-memory test server, which eliminates network latency and deployment costs while providing full control over configuration. Tests execute much faster because there's no real network communication or separate process to manage. Additionally, services can be replaced via ConfigureTestServices, which facilitates test isolation and simulation of different scenarios without external infrastructure. ## 3. What is the difference between a unit test and an integration test in ASP.NET Core? **Answer** Unit tests isolate and test a single unit of code (method, class) by mocking all dependencies, while integration tests verify that multiple components work together correctly, including the database, middleware, and real services. Unit tests are faster and simpler but don't detect integration issues, while integration tests are slower but validate the application's overall behavior. A balanced strategy combines both approaches. ## 15 more questions available - Which NuGet package is required to use WebApplicationFactory in integration tests? - How to create an HTTP client to test an API with WebApplicationFactory? Sign up for free: https://sharpskill.dev/en/login ## Other .NET interview topics - [C# Basics](https://sharpskill.dev/en/technologies/dotnet/interview-questions/csharp-basics.md): 25 questions, Junior - [LINQ & Delegates](https://sharpskill.dev/en/technologies/dotnet/interview-questions/csharp-linq-delegates.md): 20 questions, Junior - [C# Language Essentials](https://sharpskill.dev/en/technologies/dotnet/interview-questions/csharp-language-essentials.md): 15 questions, Junior - [ASP.NET Core Fundamentals](https://sharpskill.dev/en/technologies/dotnet/interview-questions/aspnet-core-fundamentals.md): 18 questions, Junior - [ASP.NET Core Request Lifecycle](https://sharpskill.dev/en/technologies/dotnet/interview-questions/aspnet-core-request-lifecycle.md): 20 questions, Junior - [Configuration & Settings](https://sharpskill.dev/en/technologies/dotnet/interview-questions/configuration-settings.md): 20 questions, Junior - [Application Lifecycle](https://sharpskill.dev/en/technologies/dotnet/interview-questions/application-lifecycle.md): 20 questions, Junior - [Dependency Injection](https://sharpskill.dev/en/technologies/dotnet/interview-questions/dependency-injection.md): 24 questions, Mid-Level - [Entity Framework Core](https://sharpskill.dev/en/technologies/dotnet/interview-questions/entity-framework-core.md): 25 questions, Mid-Level - [Minimal APIs](https://sharpskill.dev/en/technologies/dotnet/interview-questions/minimal-apis.md): 18 questions, Mid-Level - [Web API Development](https://sharpskill.dev/en/technologies/dotnet/interview-questions/web-api-development.md): 22 questions, Mid-Level - [Async in ASP.NET Core](https://sharpskill.dev/en/technologies/dotnet/interview-questions/async-aspnet-core.md): 20 questions, Mid-Level - [Authentication & Authorization](https://sharpskill.dev/en/technologies/dotnet/interview-questions/authentication-authorization.md): 18 questions, Mid-Level - [HttpClient & Networking](https://sharpskill.dev/en/technologies/dotnet/interview-questions/httpclient-networking.md): 20 questions, Mid-Level - [JSON Serialization](https://sharpskill.dev/en/technologies/dotnet/interview-questions/json-serialization.md): 20 questions, Mid-Level - [Entity Framework Core Advanced](https://sharpskill.dev/en/technologies/dotnet/interview-questions/ef-core-advanced.md): 25 questions, Mid-Level - [C# Advanced Features](https://sharpskill.dev/en/technologies/dotnet/interview-questions/csharp-advanced-features.md): 20 questions, Mid-Level - [Clean Architecture](https://sharpskill.dev/en/technologies/dotnet/interview-questions/clean-architecture.md): 20 questions, Mid-Level - [Logging, Monitoring & Observability](https://sharpskill.dev/en/technologies/dotnet/interview-questions/logging-monitoring.md): 22 questions, Mid-Level - [Unit Testing & xUnit](https://sharpskill.dev/en/technologies/dotnet/interview-questions/unit-testing-xunit.md): 20 questions, Mid-Level - [Docker & Containerization](https://sharpskill.dev/en/technologies/dotnet/interview-questions/docker-containerization.md): 16 questions, Mid-Level - [NuGet Package Management](https://sharpskill.dev/en/technologies/dotnet/interview-questions/nuget-package-management.md): 16 questions, Mid-Level - [Memory Management & GC](https://sharpskill.dev/en/technologies/dotnet/interview-questions/memory-management-gc.md): 22 questions, Senior - [Reactive Programming](https://sharpskill.dev/en/technologies/dotnet/interview-questions/reactive-programming.md): 24 questions, Senior - [Async/await & Patterns](https://sharpskill.dev/en/technologies/dotnet/interview-questions/async-await-patterns.md): 26 questions, Senior - [.NET Design Patterns](https://sharpskill.dev/en/technologies/dotnet/interview-questions/dotnet-design-patterns.md): 24 questions, Senior - [Performance Optimization](https://sharpskill.dev/en/technologies/dotnet/interview-questions/performance-optimization.md): 22 questions, Senior - [Security & Best Practices](https://sharpskill.dev/en/technologies/dotnet/interview-questions/security-best-practices.md): 24 questions, Senior - [SignalR & Real-time](https://sharpskill.dev/en/technologies/dotnet/interview-questions/signalr-realtime.md): 22 questions, Senior - [Microservices Architecture](https://sharpskill.dev/en/technologies/dotnet/interview-questions/microservices-architecture.md): 25 questions, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/en/technologies/dotnet/interview-questions/integration-testing