diff options
author | 杨宇千 <crupest@outlook.com> | 2019-08-12 16:24:17 +0800 |
---|---|---|
committer | 杨宇千 <crupest@outlook.com> | 2019-08-12 16:24:17 +0800 |
commit | afaad69437dc12ffb706667eb63875b116631234 (patch) | |
tree | af074659bc9490457f1627c520c1774895a3975f /Timeline.Tests/UserUnitTest.cs | |
parent | 4367f283f196d8b6f195855b4592bf65aa10859e (diff) | |
download | timeline-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.cs | 11 |
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
{
|