关于[Create fake user for ASP.NET Core controller tests]的摘要:
I think most of ASP.NET Core applications have authentication enabled. When writing unit tests for controllers we have one set of tests that need authenticated user and other set of tests that need anonymous user. Faking User property of controller is a little bit tricky. This blog post shows how to do it.
原文地址: https://gunnarpeipman.com/aspnet-core-test-controller-fake-user/