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
commitafaad69437dc12ffb706667eb63875b116631234 (patch)
treeaf074659bc9490457f1627c520c1774895a3975f /Timeline.Tests/UserUnitTest.cs
parent4367f283f196d8b6f195855b4592bf65aa10859e (diff)
downloadtimeline-afaad69437dc12ffb706667eb63875b116631234.tar.gz
timeline-afaad69437dc12ffb706667eb63875b116631234.tar.bz2
timeline-afaad69437dc12ffb706667eb63875b116631234.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
{