回答編集履歴
4
修正
test
CHANGED
@@ -60,16 +60,6 @@
|
|
60
60
|
|
61
61
|
|
62
62
|
|
63
|
-
this._user = new ClaimsPrincipal(new ClaimsIdentity(new Claim[] {
|
64
|
-
|
65
|
-
new Claim(ClaimTypes.Name, "Administrator"),
|
66
|
-
|
67
|
-
new Claim(ClaimTypes.Role, "Administrator")
|
68
|
-
|
69
|
-
}, "mock"));
|
70
|
-
|
71
|
-
|
72
|
-
|
73
63
|
// nullまたは空オブジェクトではだめで、It.IsAny<T>()を使うことで解決しました。
|
74
64
|
|
75
65
|
this._userCheckServiceMock.Setup(e => e.IsCheckedAsync(It.IsAny<ClaimsPrincipal>, It.IsAny<Project>())).ReturnsAsync(true);
|
@@ -85,6 +75,18 @@
|
|
85
75
|
);
|
86
76
|
|
87
77
|
|
78
|
+
|
79
|
+
// ダミーのUserはこれで対応
|
80
|
+
|
81
|
+
this._user = new ClaimsPrincipal(new ClaimsIdentity(new Claim[] {
|
82
|
+
|
83
|
+
new Claim(ClaimTypes.Name, "Administrator"),
|
84
|
+
|
85
|
+
new Claim(ClaimTypes.Role, "Administrator")
|
86
|
+
|
87
|
+
}, "mock"));
|
88
|
+
|
89
|
+
|
88
90
|
|
89
91
|
this._controller.ControllerContext = new ControllerContext() {
|
90
92
|
|
3
修正
test
CHANGED
@@ -72,7 +72,7 @@
|
|
72
72
|
|
73
73
|
// nullまたは空オブジェクトではだめで、It.IsAny<T>()を使うことで解決しました。
|
74
74
|
|
75
|
-
this._userCheckServiceMock.Setup(e => e.IsCheckedAsync(t
|
75
|
+
this._userCheckServiceMock.Setup(e => e.IsCheckedAsync(It.IsAny<ClaimsPrincipal>, It.IsAny<Project>())).ReturnsAsync(true);
|
76
76
|
|
77
77
|
|
78
78
|
|
2
修正
test
CHANGED
@@ -54,7 +54,7 @@
|
|
54
54
|
|
55
55
|
public TestsControllerTest() {
|
56
56
|
|
57
|
-
this._loggerMock = new Mock<ILogger<
|
57
|
+
this._loggerMock = new Mock<ILogger<TestsController>>();
|
58
58
|
|
59
59
|
this._userCheckServiceMock = new Mock<IUserCheckService>();
|
60
60
|
|
@@ -76,7 +76,7 @@
|
|
76
76
|
|
77
77
|
|
78
78
|
|
79
|
-
this._controller = new
|
79
|
+
this._controller = new TestsController(
|
80
80
|
|
81
81
|
this._loggerMock.Object,
|
82
82
|
|
1
修正
test
CHANGED
@@ -72,7 +72,7 @@
|
|
72
72
|
|
73
73
|
// nullまたは空オブジェクトではだめで、It.IsAny<T>()を使うことで解決しました。
|
74
74
|
|
75
|
-
this._userCheckServiceMock.Setup(e => e.IsCheckedAsync(this._user,
|
75
|
+
this._userCheckServiceMock.Setup(e => e.IsCheckedAsync(this._user, It.IsAny<Project>())).ReturnsAsync(true);
|
76
76
|
|
77
77
|
|
78
78
|
|