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
commit2198ad257a2c049f3601a6f95b8906c5be8b27d5 (patch)
tree7d034bb824b50d892136c6f1225a15e8baa30741 /Timeline.Tests/Controllers/UserDetailControllerTest.cs
parentfbaa8cab95a91b887bbd2d108d27c5abb38e4e29 (diff)
downloadtimeline-2198ad257a2c049f3601a6f95b8906c5be8b27d5.tar.gz
timeline-2198ad257a2c049f3601a6f95b8906c5be8b27d5.tar.bz2
timeline-2198ad257a2c049f3601a6f95b8906c5be8b27d5.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>();