我正在使用 Mediatr 库来注册和调用我的 RequestHandler。\n一切都很顺利,直到我开始阅读有关集成测试的更多信息。
\n编辑后请阅读
\n我无法调用继承自 RequesHandler 的类。
\n我的班级是这样的:
\npublic class MyRequestHandler : RequestHandler<MyRequest, MyResponse>\n{\n ....\n}\nRun Code Online (Sandbox Code Playgroud)\n我没有使用 Meditr异步,而是使用 .net Framework 4.7 而不是 asp.net core,因此,一切看起来都返回了我对 asp.net core 的答案。
\n当我构建时MyTestClass,要构建RequestHandler我必须创建一个ServiceFactory,也许这就是问题,因为我不知道如何。
public MyClassTest()\n {\n ServiceFactory sv = null;\n _mediator = new Mediator(sv);\n }\nRun Code Online (Sandbox Code Playgroud)\n编辑
\n提供更多信息
\n我的应用程序层中有这个处理程序
\npublic class LogInUserByFormHandler : RequestHandler<LogInUserByFormRequest, LogInUserByFormResponse>\n{\n private readonly IValidator<LogInUserByFormRequest> _validator;\n\n public LogInUserByFormHandler(IValidator<LogInUserByFormRequest> validator)\n {\n _validator = validator;\n }\n\n …Run Code Online (Sandbox Code Playgroud) 我正在尝试安装 npm install --save @ng-bootstrap/ng-bootstrap 出现以下错误。请帮我解决这个问题。
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: bidashboard@0.0.0
npm ERR! Found: @angular/compiler@13.1.3
npm ERR! node_modules/@angular/compiler
npm ERR! @angular/compiler@"~13.1.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/compiler@"13.2.3" from @angular/localize@13.2.3
npm ERR! node_modules/@angular/localize
npm ERR! peer @angular/localize@"^13.0.0" from @ng-bootstrap/ng-bootstrap@12.0.0
npm ERR! node_modules/@ng-bootstrap/ng-bootstrap
npm ERR! @ng-bootstrap/ng-bootstrap@"^12.0.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency …Run Code Online (Sandbox Code Playgroud)