aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline.Tests/IntegratedTests
diff options
context:
space:
mode:
Diffstat (limited to 'BackEnd/Timeline.Tests/IntegratedTests')
-rw-r--r--BackEnd/Timeline.Tests/IntegratedTests/TimelineTest.cs12
-rw-r--r--BackEnd/Timeline.Tests/IntegratedTests/UserAvatarTest.cs6
-rw-r--r--BackEnd/Timeline.Tests/IntegratedTests/UserPermissionTest.cs4
-rw-r--r--BackEnd/Timeline.Tests/IntegratedTests/UserTest.cs8
4 files changed, 15 insertions, 15 deletions
diff --git a/BackEnd/Timeline.Tests/IntegratedTests/TimelineTest.cs b/BackEnd/Timeline.Tests/IntegratedTests/TimelineTest.cs
index e2ce8875..0e7bb735 100644
--- a/BackEnd/Timeline.Tests/IntegratedTests/TimelineTest.cs
+++ b/BackEnd/Timeline.Tests/IntegratedTests/TimelineTest.cs
@@ -188,7 +188,7 @@ namespace Timeline.Tests.IntegratedTests
body.Should().BeEquivalentTo(await client.GetTimelineAsync("aaa"));
}
- await client.TestPostAssertErrorAsync("timelines", new HttpTimelineCreateRequest { Name = "aaa" }, errorCode: ErrorCodes.TimelineController.NameConflict);
+ await client.TestPostAssertErrorAsync("timelines", new HttpTimelineCreateRequest { Name = "aaa" }, errorCode: ErrorCodes.Conflict.Timeline);
}
}
@@ -210,7 +210,7 @@ namespace Timeline.Tests.IntegratedTests
await client.TestDeleteAssertInvalidModelAsync("timelines/!!!");
await client.TestDeleteAsync("timelines/t2");
- await client.TestDeleteAssertErrorAsync("timelines/t2");
+ await client.TestDeleteAsync("timelines/t2");
}
{
@@ -218,7 +218,7 @@ namespace Timeline.Tests.IntegratedTests
await client.TestDeleteAssertInvalidModelAsync("timelines/!!!");
await client.TestDeleteAsync("timelines/t1");
- await client.TestDeleteAssertErrorAsync("timelines/t1");
+ await client.TestDeleteAsync("timelines/t1");
}
}
@@ -294,13 +294,13 @@ namespace Timeline.Tests.IntegratedTests
}
await AssertEmptyMembers();
- await client.TestPutAssertErrorAsync($"timelines/{timelineName}/members/usernotexist", errorCode: ErrorCodes.UserCommon.NotExist);
+ await client.TestPutAssertErrorAsync($"timelines/{timelineName}/members/usernotexist", errorCode: ErrorCodes.NotExist.User);
await AssertEmptyMembers();
await client.PutTimelineMemberAsync(timelineName, "user2");
await AssertMembers(new List<HttpUser> { await client.GetUserAsync("user2") });
await client.DeleteTimelineMemberAsync(timelineName, "user2", true);
await AssertEmptyMembers();
- await client.TestDeleteAssertErrorAsync($"timelines/{timelineName}/members/usernotexist", errorCode: ErrorCodes.UserCommon.NotExist);
+ await client.TestDeleteAsync($"timelines/{timelineName}/members/usernotexist", false);
await AssertEmptyMembers();
}
@@ -377,7 +377,7 @@ namespace Timeline.Tests.IntegratedTests
using (var client = await CreateClientAsUser())
{
await client.TestPatchAssertInvalidModelAsync("timelines/t1", new HttpTimelinePatchRequest { Name = "!!!" });
- await client.TestPatchAssertErrorAsync("timelines/t1", new HttpTimelinePatchRequest { Name = "t2" }, errorCode: ErrorCodes.TimelineController.NameConflict);
+ await client.TestPatchAssertErrorAsync("timelines/t1", new HttpTimelinePatchRequest { Name = "t2" }, errorCode: ErrorCodes.Conflict.Timeline);
await client.TestPatchAsync("timelines/t1", new HttpTimelinePatchRequest { Name = "newt" });
diff --git a/BackEnd/Timeline.Tests/IntegratedTests/UserAvatarTest.cs b/BackEnd/Timeline.Tests/IntegratedTests/UserAvatarTest.cs
index 708120b1..c2ccff64 100644
--- a/BackEnd/Timeline.Tests/IntegratedTests/UserAvatarTest.cs
+++ b/BackEnd/Timeline.Tests/IntegratedTests/UserAvatarTest.cs
@@ -30,7 +30,7 @@ namespace Timeline.Tests.IntegratedTests
using (var client = await CreateClientAsUser())
{
- await client.TestGetAssertNotFoundAsync("users/usernotexist/avatar", errorCode: ErrorCodes.UserCommon.NotExist);
+ await client.TestGetAssertNotFoundAsync("users/usernotexist/avatar", errorCode: ErrorCodes.NotExist.User);
var env = TestApp.Host.Services.GetRequiredService<IWebHostEnvironment>();
var defaultAvatarData = await File.ReadAllBytesAsync(Path.Combine(env.ContentRootPath, "default-avatar.png"));
@@ -138,8 +138,8 @@ namespace Timeline.Tests.IntegratedTests
{
await client.TestPutByteArrayAsync("users/user1/avatar", mockAvatar.Data, mockAvatar.ContentType);
await client.TestDeleteAsync("users/user1/avatar");
- await client.TestPutByteArrayAssertErrorAsync("users/usernotexist/avatar", new[] { (byte)0x00 }, "image/png", errorCode: ErrorCodes.UserCommon.NotExist);
- await client.TestDeleteAssertErrorAsync("users/usernotexist/avatar", errorCode: ErrorCodes.UserCommon.NotExist);
+ await client.TestPutByteArrayAssertErrorAsync("users/usernotexist/avatar", new[] { (byte)0x00 }, "image/png", errorCode: ErrorCodes.NotExist.User);
+ await client.TestDeleteAsync("users/usernotexist/avatar");
}
// bad username check
diff --git a/BackEnd/Timeline.Tests/IntegratedTests/UserPermissionTest.cs b/BackEnd/Timeline.Tests/IntegratedTests/UserPermissionTest.cs
index 32e25aaa..83dc51f9 100644
--- a/BackEnd/Timeline.Tests/IntegratedTests/UserPermissionTest.cs
+++ b/BackEnd/Timeline.Tests/IntegratedTests/UserPermissionTest.cs
@@ -190,8 +190,8 @@ namespace Timeline.Tests.IntegratedTests
const string url = "users/user123/permissions/UserManagement";
- await client.TestPutAssertNotFoundAsync(url, errorCode: ErrorCodes.UserCommon.NotExist);
- await client.TestDeleteAssertNotFoundAsync(url, errorCode: ErrorCodes.UserCommon.NotExist);
+ await client.TestPutAssertErrorAsync(url, errorCode: ErrorCodes.NotExist.User);
+ await client.TestDeleteAsync(url);
}
}
}
diff --git a/BackEnd/Timeline.Tests/IntegratedTests/UserTest.cs b/BackEnd/Timeline.Tests/IntegratedTests/UserTest.cs
index c728a280..7286e12e 100644
--- a/BackEnd/Timeline.Tests/IntegratedTests/UserTest.cs
+++ b/BackEnd/Timeline.Tests/IntegratedTests/UserTest.cs
@@ -47,7 +47,7 @@ namespace Timeline.Tests.IntegratedTests
public async Task Get_404()
{
using var client = await CreateDefaultClient();
- await client.TestGetAssertNotFoundAsync("users/usernotexist", errorCode: ErrorCodes.UserCommon.NotExist);
+ await client.TestGetAssertNotFoundAsync("users/usernotexist", errorCode: ErrorCodes.NotExist.User);
}
[Fact]
@@ -104,7 +104,7 @@ namespace Timeline.Tests.IntegratedTests
public async Task Patch_NotExist()
{
using var client = await CreateClientAsAdministrator();
- await client.TestPatchAssertNotFoundAsync("users/usernotexist", new HttpUserPatchRequest { }, errorCode: ErrorCodes.UserCommon.NotExist);
+ await client.TestPatchAssertErrorAsync("users/usernotexist", new HttpUserPatchRequest { }, errorCode: ErrorCodes.NotExist.User);
}
[Fact]
@@ -133,7 +133,7 @@ namespace Timeline.Tests.IntegratedTests
public async Task Patch_UsernameConflict()
{
using var client = await CreateClientAsAdministrator();
- await client.TestPatchAssertErrorAsync("users/user1", new HttpUserPatchRequest { Username = "admin" }, errorCode: ErrorCodes.UserController.UsernameConflict);
+ await client.TestPatchAssertErrorAsync("users/user1", new HttpUserPatchRequest { Username = "admin" }, errorCode: ErrorCodes.Conflict.User);
}
[Fact]
@@ -255,7 +255,7 @@ namespace Timeline.Tests.IntegratedTests
{
Username = "user1",
Password = "bbb",
- }, errorCode: ErrorCodes.UserController.UsernameConflict);
+ }, errorCode: ErrorCodes.Conflict.User);
}
[Fact]