diff options
author | 杨宇千 <crupest@outlook.com> | 2019-08-12 22:39:38 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-12 22:39:38 +0800 |
commit | ff7a7bdb8807f4b7faaaaf56677a99b23ac3c6ba (patch) | |
tree | af074659bc9490457f1627c520c1774895a3975f /Timeline.Tests/UserUnitTest.cs | |
parent | ac072939e727181f79e3d6d1acd7d7ac1f4c29f6 (diff) | |
parent | 1073d54813a25e1e9c0c41b989c69f77d2aca9cb (diff) | |
download | timeline-ff7a7bdb8807f4b7faaaaf56677a99b23ac3c6ba.tar.gz timeline-ff7a7bdb8807f4b7faaaaf56677a99b23ac3c6ba.tar.bz2 timeline-ff7a7bdb8807f4b7faaaaf56677a99b23ac3c6ba.zip |
Merge pull request #40 from crupest/format
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
{
|