关于[ASP.NET Core Integration Testing & Mocking using Moq]的摘要:
If you want to run an integration test for your ASP.NET Core app without also testing lots of external dependencies like databases and the like, then the lengthy official ‘Integration tests in ASP.NET Core‘ documentation shows how you can use stubs to replace code that talks to a database or some other external service. If you want to use mocks, this is where you run out of guidance and runway. It does in fact require a fair amount of setup to do it correctly and reliably without getting flaky tests.
原文地址: https://rehansaeed.com/asp-net-core-integration-testing-mocking-using-moq/