質問編集履歴
7
test
CHANGED
File without changes
|
test
CHANGED
@@ -84,7 +84,7 @@
|
|
84
84
|
|
85
85
|
public TestsControllerTest() {
|
86
86
|
|
87
|
-
this._loggerMock = new Mock<ILogger<
|
87
|
+
this._loggerMock = new Mock<ILogger<TestsController>>();
|
88
88
|
|
89
89
|
this._userCheckServiceMock = new Mock<IUserCheckService>();
|
90
90
|
|
@@ -112,7 +112,7 @@
|
|
112
112
|
|
113
113
|
|
114
114
|
|
115
|
-
this._controller = new
|
115
|
+
this._controller = new TestsController(
|
116
116
|
|
117
117
|
this._loggerMock.Object,
|
118
118
|
|
6
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -26,6 +26,12 @@
|
|
26
26
|
|
27
27
|
|
28
28
|
|
29
|
+
(追記)
|
30
|
+
|
31
|
+
開発環境: Windows10 Pro, Visual Studio Professional 2019, .NET 5
|
32
|
+
|
33
|
+
|
34
|
+
|
29
35
|
```C#
|
30
36
|
|
31
37
|
using ApplicationService;
|
5
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
ユニットテストを作成しています。MoqのSetupで引数を2つ指定すると、正しくSetupをしてくれない場合があり、困っています。
|
1
|
+
C#、ASP.NET Core MVCでユニットテストを作成しています。MoqのSetupで引数を2つ指定すると、正しくSetupをしてくれない場合があり、困っています。
|
2
2
|
|
3
3
|
どなたかご教授お願いします。
|
4
4
|
|
4
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -28,6 +28,24 @@
|
|
28
28
|
|
29
29
|
```C#
|
30
30
|
|
31
|
+
using ApplicationService;
|
32
|
+
|
33
|
+
using DomainModel;
|
34
|
+
|
35
|
+
using DomainService;
|
36
|
+
|
37
|
+
using Microsoft.AspNetCore.Http;
|
38
|
+
|
39
|
+
using Microsoft.AspNetCore.Mvc;
|
40
|
+
|
41
|
+
using Microsoft.Extensions.Logging;
|
42
|
+
|
43
|
+
using Moq;
|
44
|
+
|
45
|
+
using System;
|
46
|
+
|
47
|
+
using System.Collections.Generic;
|
48
|
+
|
31
49
|
using System.Linq;
|
32
50
|
|
33
51
|
using System.Security.Claims;
|
3
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -54,7 +54,7 @@
|
|
54
54
|
|
55
55
|
private ClaimsPrincipal _user = null;
|
56
56
|
|
57
|
-
private
|
57
|
+
private TestsController _controller = null;
|
58
58
|
|
59
59
|
|
60
60
|
|
2
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -166,7 +166,7 @@
|
|
166
166
|
|
167
167
|
public class TestsController : Controller {
|
168
168
|
|
169
|
-
private readonly ILogger<
|
169
|
+
private readonly ILogger<TestsController> _logger;
|
170
170
|
|
171
171
|
private readonly IUserCheckService _userCheckService;
|
172
172
|
|
1
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -22,6 +22,10 @@
|
|
22
22
|
|
23
23
|
|
24
24
|
|
25
|
+
①の作り方をした時のみ、現象が発生しています。
|
26
|
+
|
27
|
+
|
28
|
+
|
25
29
|
```C#
|
26
30
|
|
27
31
|
using System.Linq;
|