aboutsummaryrefslogtreecommitdiff
path: root/Timeline.Tests/Controllers/UserDetailControllerTest.cs
diff options
context:
space:
mode:
author杨宇千 <crupest@outlook.com>2019-10-31 00:56:46 +0800
committer杨宇千 <crupest@outlook.com>2019-10-31 00:56:46 +0800
commitd3a1bf5f2939049f11e77f91ad9ddea30d8acd64 (patch)
tree7d034bb824b50d892136c6f1225a15e8baa30741 /Timeline.Tests/Controllers/UserDetailControllerTest.cs
parent006d799d2fe5f081c188f95a8590c4b75a93caae (diff)
downloadtimeline-d3a1bf5f2939049f11e77f91ad9ddea30d8acd64.tar.gz
timeline-d3a1bf5f2939049f11e77f91ad9ddea30d8acd64.tar.bz2
timeline-d3a1bf5f2939049f11e77f91ad9ddea30d8acd64.zip
Continue to construct feature and tests.
Diffstat (limited to 'Timeline.Tests/Controllers/UserDetailControllerTest.cs')
-rw-r--r--Timeline.Tests/Controllers/UserDetailControllerTest.cs5
1 files changed, 5 insertions, 0 deletions
diff --git a/Timeline.Tests/Controllers/UserDetailControllerTest.cs b/Timeline.Tests/Controllers/UserDetailControllerTest.cs
index 99341c40..ffd88790 100644
--- a/Timeline.Tests/Controllers/UserDetailControllerTest.cs
+++ b/Timeline.Tests/Controllers/UserDetailControllerTest.cs
@@ -1,4 +1,5 @@
using FluentAssertions;
+using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Moq;
using System;
@@ -42,6 +43,8 @@ namespace Timeline.Tests.Controllers
var putNickname = typeof(UserDetailController).GetMethod(nameof(UserDetailController.PutNickname));
putNickname.Should().BeDecoratedWith<HttpPutAttribute>()
+ .And.BeDecoratedWith<AuthorizeAttribute>()
+ .And.BeDecoratedWith<SelfOrAdminAttribute>()
.And.BeDecoratedWith<CatchUserNotExistExceptionAttribute>();
putNickname.GetParameter("username").Should().BeDecoratedWith<UsernameAttribute>()
.And.BeDecoratedWith<FromRouteAttribute>();
@@ -53,6 +56,8 @@ namespace Timeline.Tests.Controllers
var deleteNickname = typeof(UserDetailController).GetMethod(nameof(UserDetailController.DeleteNickname));
deleteNickname.Should().BeDecoratedWith<HttpDeleteAttribute>()
+ .And.BeDecoratedWith<AuthorizeAttribute>()
+ .And.BeDecoratedWith<SelfOrAdminAttribute>()
.And.BeDecoratedWith<CatchUserNotExistExceptionAttribute>();
deleteNickname.GetParameter("username").Should().BeDecoratedWith<UsernameAttribute>()
.And.BeDecoratedWith<FromRouteAttribute>();