你的位置: 码友网首页 / 资讯源列表 / Create fake user for ASP.NET Core controller tests

关于[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/

收录时间: 2020-01-14 浏览量: 1951 分类: ASP.NET Core

| 0 收藏 | 0