aboutsummaryrefslogtreecommitdiff
path: root/Timeline.Tests/UserUnitTest.cs
diff options
context:
space:
mode:
author杨宇千 <crupest@outlook.com>2019-08-12 16:24:17 +0800
committer杨宇千 <crupest@outlook.com>2019-08-12 16:24:17 +0800
commit1073d54813a25e1e9c0c41b989c69f77d2aca9cb (patch)
treeaf074659bc9490457f1627c520c1774895a3975f /Timeline.Tests/UserUnitTest.cs
parent09b07992d4316899ee6878585622c0762588a82a (diff)
downloadtimeline-1073d54813a25e1e9c0c41b989c69f77d2aca9cb.tar.gz
timeline-1073d54813a25e1e9c0c41b989c69f77d2aca9cb.tar.bz2
timeline-1073d54813a25e1e9c0c41b989c69f77d2aca9cb.zip
Add username format check.
Diffstat (limited to 'Timeline.Tests/UserUnitTest.cs')
-rw-r--r--Timeline.Tests/UserUnitTest.cs11
1 files changed, 11 insertions, 0 deletions
diff --git a/Timeline.Tests/UserUnitTest.cs b/Timeline.Tests/UserUnitTest.cs
index 1f72000c..2aa89fe3 100644
--- a/Timeline.Tests/UserUnitTest.cs
+++ b/Timeline.Tests/UserUnitTest.cs
@@ -79,6 +79,17 @@ namespace Timeline.Tests
}
{
+ // Put Bad Username.
+ var res = await client.PutAsJsonAsync("users/dsf fddf", new UserPutRequest
+ {
+ Password = password,
+ Administrator = false
+ });
+ res.Should().HaveStatusCodeBadRequest()
+ .And.Should().HaveBodyAsCommonResponseWithCode(UserController.ErrorCodes.Put_BadUsername);
+ }
+
+ {
// Put Created.
var res = await client.PutAsJsonAsync(url, new UserPutRequest
{