aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline.Tests
diff options
context:
space:
mode:
Diffstat (limited to 'BackEnd/Timeline.Tests')
-rw-r--r--BackEnd/Timeline.Tests/GlobalSuppressions.cs25
-rw-r--r--BackEnd/Timeline.Tests/Helpers/TestDatabase.cs2
-rw-r--r--BackEnd/Timeline.Tests/IntegratedTests/HttpClientTimelineExtensions.cs8
-rw-r--r--BackEnd/Timeline.Tests/IntegratedTests/HttpClientUserExtensions.cs4
-rw-r--r--BackEnd/Timeline.Tests/IntegratedTests/IntegratedTestBase.cs4
-rw-r--r--BackEnd/Timeline.Tests/IntegratedTests/TimelineTest.cs150
-rw-r--r--BackEnd/Timeline.Tests/IntegratedTests/TokenTest.cs24
-rw-r--r--BackEnd/Timeline.Tests/IntegratedTests/UserTest.cs66
-rw-r--r--BackEnd/Timeline.Tests/Services/HighlightTimelineServiceTest.cs43
-rw-r--r--BackEnd/Timeline.Tests/Services/TimelinePostServiceTest.cs200
-rw-r--r--BackEnd/Timeline.Tests/Services/TimelineServiceTest.cs174
-rw-r--r--BackEnd/Timeline.Tests/Services/UserDeleteServiceTest.cs4
-rw-r--r--BackEnd/Timeline.Tests/packages.lock.json50
13 files changed, 417 insertions, 337 deletions
diff --git a/BackEnd/Timeline.Tests/GlobalSuppressions.cs b/BackEnd/Timeline.Tests/GlobalSuppressions.cs
index 0f873033..da9481f1 100644
--- a/BackEnd/Timeline.Tests/GlobalSuppressions.cs
+++ b/BackEnd/Timeline.Tests/GlobalSuppressions.cs
@@ -3,14 +3,17 @@
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Reliability", "CA2007:Consider calling ConfigureAwait on the awaited task", Justification = "This is not a UI application.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores", Justification = "Tests name have underscores.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "Test may catch all exceptions.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1034:Nested types should not be visible", Justification = "Test classes can be nested.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1062:Validate arguments of public methods", Justification = "This is redundant.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1063:Implement IDisposable Correctly", Justification = "Test classes do not need to implement it that way.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA1816:Dispose methods should call SuppressFinalize", Justification = "Test classes do not need to implement it that way.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2234:Pass system uri objects instead of strings", Justification = "I really don't understand this rule.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Globalization", "CA1303:Do not pass literals as localized parameters", Justification = "Tests do not need make strings resources.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1054:Uri parameters should not be strings", Justification = "That's unnecessary.")]
-[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1056:Uri properties should not be strings", Justification = "That's unnecessary.")]
+using System.Diagnostics.CodeAnalysis;
+
+[assembly: SuppressMessage("Reliability", "CA2007:Consider calling ConfigureAwait on the awaited task", Justification = "This is not a UI application.")]
+[assembly: SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores", Justification = "Tests name have underscores.")]
+[assembly: SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "Test may catch all exceptions.")]
+[assembly: SuppressMessage("Design", "CA1034:Nested types should not be visible", Justification = "Test classes can be nested.")]
+[assembly: SuppressMessage("Design", "CA1062:Validate arguments of public methods", Justification = "This is redundant.")]
+[assembly: SuppressMessage("Design", "CA1063:Implement IDisposable Correctly", Justification = "Test classes do not need to implement it that way.")]
+[assembly: SuppressMessage("Usage", "CA1816:Dispose methods should call SuppressFinalize", Justification = "Test classes do not need to implement it that way.")]
+[assembly: SuppressMessage("Usage", "CA2234:Pass system uri objects instead of strings", Justification = "I really don't understand this rule.")]
+[assembly: SuppressMessage("Globalization", "CA1303:Do not pass literals as localized parameters", Justification = "Tests do not need make strings resources.")]
+[assembly: SuppressMessage("Design", "CA1054:Uri parameters should not be strings", Justification = "That's unnecessary.")]
+[assembly: SuppressMessage("Design", "CA1056:Uri properties should not be strings", Justification = "That's unnecessary.")]
+[assembly: SuppressMessage("Design", "CA1001:Types that own disposable fields should be disposable", Justification = "We use another contract like IAsyncLifetime.")]
diff --git a/BackEnd/Timeline.Tests/Helpers/TestDatabase.cs b/BackEnd/Timeline.Tests/Helpers/TestDatabase.cs
index 74db74aa..a71c2208 100644
--- a/BackEnd/Timeline.Tests/Helpers/TestDatabase.cs
+++ b/BackEnd/Timeline.Tests/Helpers/TestDatabase.cs
@@ -35,7 +35,7 @@ namespace Timeline.Tests.Helpers
if (_createUser)
{
var passwordService = new PasswordService();
- var userService = new UserService(NullLogger<UserService>.Instance, context, passwordService, new Clock(), new UserPermissionService(context));
+ var userService = new UserService(NullLogger<UserService>.Instance, context, passwordService, new UserPermissionService(context), new Clock());
var admin = await userService.CreateUser("admin", "adminpw");
await userService.ModifyUser(admin.Id, new ModifyUserParams() { Nickname = "administrator" });
diff --git a/BackEnd/Timeline.Tests/IntegratedTests/HttpClientTimelineExtensions.cs b/BackEnd/Timeline.Tests/IntegratedTests/HttpClientTimelineExtensions.cs
index 8e48ccbf..ac60ce7c 100644
--- a/BackEnd/Timeline.Tests/IntegratedTests/HttpClientTimelineExtensions.cs
+++ b/BackEnd/Timeline.Tests/IntegratedTests/HttpClientTimelineExtensions.cs
@@ -6,11 +6,11 @@ namespace Timeline.Tests.IntegratedTests
{
public static class HttpClientTimelineExtensions
{
- public static Task<TimelineInfo> GetTimelineAsync(this HttpClient client, string timelineName)
- => client.TestGetAsync<TimelineInfo>($"timelines/{timelineName}");
+ public static Task<HttpTimeline> GetTimelineAsync(this HttpClient client, string timelineName)
+ => client.TestGetAsync<HttpTimeline>($"timelines/{timelineName}");
- public static Task<TimelineInfo> PatchTimelineAsync(this HttpClient client, string timelineName, TimelinePatchRequest body)
- => client.TestPatchAsync<TimelineInfo>($"timelines/{timelineName}", body);
+ public static Task<HttpTimeline> PatchTimelineAsync(this HttpClient client, string timelineName, HttpTimelinePatchRequest body)
+ => client.TestPatchAsync<HttpTimeline>($"timelines/{timelineName}", body);
public static Task PutTimelineMemberAsync(this HttpClient client, string timelineName, string memberUsername)
=> client.TestPutAsync($"timelines/{timelineName}/members/{memberUsername}");
diff --git a/BackEnd/Timeline.Tests/IntegratedTests/HttpClientUserExtensions.cs b/BackEnd/Timeline.Tests/IntegratedTests/HttpClientUserExtensions.cs
index 81787eef..7ca62e38 100644
--- a/BackEnd/Timeline.Tests/IntegratedTests/HttpClientUserExtensions.cs
+++ b/BackEnd/Timeline.Tests/IntegratedTests/HttpClientUserExtensions.cs
@@ -6,7 +6,7 @@ namespace Timeline.Tests.IntegratedTests
{
public static class HttpClientUserExtensions
{
- public static Task<UserInfo> GetUserAsync(this HttpClient client, string username)
- => client.TestGetAsync<UserInfo>($"users/{username}");
+ public static Task<HttpUser> GetUserAsync(this HttpClient client, string username)
+ => client.TestGetAsync<HttpUser>($"users/{username}");
}
}
diff --git a/BackEnd/Timeline.Tests/IntegratedTests/IntegratedTestBase.cs b/BackEnd/Timeline.Tests/IntegratedTests/IntegratedTestBase.cs
index e426ac98..82aed24e 100644
--- a/BackEnd/Timeline.Tests/IntegratedTests/IntegratedTestBase.cs
+++ b/BackEnd/Timeline.Tests/IntegratedTests/IntegratedTestBase.cs
@@ -103,8 +103,8 @@ namespace Timeline.Tests.IntegratedTests
public async Task<HttpClient> CreateClientWithCredential(string username, string password, bool setApiBase = true)
{
var client = await CreateDefaultClient(setApiBase);
- var res = await client.TestPostAsync<CreateTokenResponse>("token/create",
- new CreateTokenRequest { Username = username, Password = password });
+ var res = await client.TestPostAsync<HttpCreateTokenResponse>("token/create",
+ new HttpCreateTokenRequest { Username = username, Password = password });
var token = res.Token;
client.DefaultRequestHeaders.Add("Authorization", "Bearer " + token);
return client;
diff --git a/BackEnd/Timeline.Tests/IntegratedTests/TimelineTest.cs b/BackEnd/Timeline.Tests/IntegratedTests/TimelineTest.cs
index 9845e1b1..12dd2b8d 100644
--- a/BackEnd/Timeline.Tests/IntegratedTests/TimelineTest.cs
+++ b/BackEnd/Timeline.Tests/IntegratedTests/TimelineTest.cs
@@ -19,20 +19,20 @@ namespace Timeline.Tests.IntegratedTests
{
public static class TimelineHelper
{
- public static TimelinePostContentInfo TextPostContent(string text)
+ public static HttpTimelinePostContent TextPostContent(string text)
{
- return new TimelinePostContentInfo
+ return new HttpTimelinePostContent
{
Type = "text",
Text = text
};
}
- public static TimelinePostCreateRequest TextPostCreateRequest(string text, DateTime? time = null)
+ public static HttpTimelinePostCreateRequest TextPostCreateRequest(string text, DateTime? time = null)
{
- return new TimelinePostCreateRequest
+ return new HttpTimelinePostCreateRequest
{
- Content = new TimelinePostCreateRequestContent
+ Content = new HttpTimelinePostCreateRequestContent
{
Type = "text",
Text = text
@@ -72,7 +72,7 @@ namespace Timeline.Tests.IntegratedTests
{
- var body = await client.TestGetAsync<TimelineInfo>("timelines/@user1");
+ var body = await client.TestGetAsync<HttpTimeline>("timelines/@user1");
body.Owner.Should().BeEquivalentTo(await client.GetUserAsync("user1"));
body.Visibility.Should().Be(TimelineVisibility.Register);
body.Description.Should().Be("");
@@ -84,7 +84,7 @@ namespace Timeline.Tests.IntegratedTests
}
{
- var body = await client.TestGetAsync<TimelineInfo>("timelines/t1");
+ var body = await client.TestGetAsync<HttpTimeline>("timelines/t1");
body.Owner.Should().BeEquivalentTo(await client.GetUserAsync("user1"));
body.Visibility.Should().Be(TimelineVisibility.Register);
body.Description.Should().Be("");
@@ -101,7 +101,7 @@ namespace Timeline.Tests.IntegratedTests
{
using var client = await CreateDefaultClient();
- var result = new List<TimelineInfo>
+ var result = new List<HttpTimeline>
{
await client.GetTimelineAsync("@user1")
};
@@ -112,7 +112,7 @@ namespace Timeline.Tests.IntegratedTests
}
- var body = await client.TestGetAsync<List<TimelineInfo>>("timelines");
+ var body = await client.TestGetAsync<List<HttpTimeline>>("timelines");
body.Should().BeEquivalentTo(result);
}
@@ -127,14 +127,14 @@ namespace Timeline.Tests.IntegratedTests
await client.TestGetAssertInvalidModelAsync("timelines?visibility=aaa");
}
- var testResultRelate = new List<TimelineInfo>();
- var testResultOwn = new List<TimelineInfo>();
- var testResultJoin = new List<TimelineInfo>();
- var testResultOwnPrivate = new List<TimelineInfo>();
- var testResultRelatePublic = new List<TimelineInfo>();
- var testResultRelateRegister = new List<TimelineInfo>();
- var testResultJoinPrivate = new List<TimelineInfo>();
- var testResultPublic = new List<TimelineInfo>();
+ var testResultRelate = new List<HttpTimeline>();
+ var testResultOwn = new List<HttpTimeline>();
+ var testResultJoin = new List<HttpTimeline>();
+ var testResultOwnPrivate = new List<HttpTimeline>();
+ var testResultRelatePublic = new List<HttpTimeline>();
+ var testResultRelateRegister = new List<HttpTimeline>();
+ var testResultJoinPrivate = new List<HttpTimeline>();
+ var testResultPublic = new List<HttpTimeline>();
{
using var client = await CreateClientAsUser();
@@ -185,8 +185,8 @@ namespace Timeline.Tests.IntegratedTests
{
using var client = await CreateClientAs(3);
- await client.PatchTimelineAsync("@user3", new TimelinePatchRequest { Visibility = TimelineVisibility.Private });
- await client.PatchTimelineAsync("t3", new TimelinePatchRequest { Visibility = TimelineVisibility.Register });
+ await client.PatchTimelineAsync("@user3", new HttpTimelinePatchRequest { Visibility = TimelineVisibility.Private });
+ await client.PatchTimelineAsync("t3", new HttpTimelinePatchRequest { Visibility = TimelineVisibility.Register });
{
var timeline = await client.GetTimelineAsync("@user3");
@@ -206,9 +206,9 @@ namespace Timeline.Tests.IntegratedTests
{
using var client = await CreateDefaultClient();
- async Task TestAgainst(string url, List<TimelineInfo> against)
+ async Task TestAgainst(string url, List<HttpTimeline> against)
{
- var body = await client.TestGetAsync<List<TimelineInfo>>(url);
+ var body = await client.TestGetAsync<List<HttpTimeline>>(url);
body.Should().BeEquivalentTo(against);
}
@@ -236,7 +236,7 @@ namespace Timeline.Tests.IntegratedTests
await client.TestPostAssertInvalidModelAsync("timelines", new TimelineCreateRequest { Name = "!!!" });
{
- var body = await client.TestPostAsync<TimelineInfo>("timelines", new TimelineCreateRequest { Name = "aaa" });
+ var body = await client.TestPostAsync<HttpTimeline>("timelines", new TimelineCreateRequest { Name = "aaa" });
body.Should().BeEquivalentTo(await client.GetTimelineAsync("aaa"));
}
@@ -342,7 +342,7 @@ namespace Timeline.Tests.IntegratedTests
var timelineName = generator(1);
- async Task AssertMembers(List<UserInfo> members)
+ async Task AssertMembers(List<HttpUser> members)
{
var body = await client.GetTimelineAsync(timelineName);
body.Members.Should().NotBeNull().And.BeEquivalentTo(members);
@@ -358,7 +358,7 @@ namespace Timeline.Tests.IntegratedTests
await client.TestPutAssertErrorAsync($"timelines/{timelineName}/members/usernotexist", errorCode: ErrorCodes.TimelineController.MemberPut_NotExist);
await AssertEmptyMembers();
await client.PutTimelineMemberAsync(timelineName, "user2");
- await AssertMembers(new List<UserInfo> { await client.GetUserAsync("user2") });
+ await AssertMembers(new List<HttpUser> { await client.GetUserAsync("user2") });
await client.DeleteTimelineMemberAsync(timelineName, "user2", true);
await AssertEmptyMembers();
await client.DeleteTimelineMemberAsync(timelineName, "aaa", false);
@@ -462,7 +462,7 @@ namespace Timeline.Tests.IntegratedTests
async Task<long> CreatePost(int userNumber)
{
using var client = await CreateClientAs(userNumber);
- var body = await client.TestPostAsync<TimelinePostInfo>($"timelines/{generator(1)}/posts", TimelineHelper.TextPostCreateRequest("aaa"));
+ var body = await client.TestPostAsync<HttpTimelinePost>($"timelines/{generator(1)}/posts", TimelineHelper.TextPostCreateRequest("aaa"));
return body.Id;
}
@@ -515,28 +515,28 @@ namespace Timeline.Tests.IntegratedTests
using var client = await CreateClientAsUser();
{
- var body = await client.TestGetAsync<List<TimelinePostInfo>>($"timelines/{generator(1)}/posts");
+ var body = await client.TestGetAsync<List<HttpTimelinePost>>($"timelines/{generator(1)}/posts");
body.Should().BeEmpty();
}
const string mockContent = "aaa";
- TimelinePostInfo createRes;
+ HttpTimelinePost createRes;
{
- var body = await client.TestPostAsync<TimelinePostInfo>($"timelines/{generator(1)}/posts", TimelineHelper.TextPostCreateRequest(mockContent));
+ var body = await client.TestPostAsync<HttpTimelinePost>($"timelines/{generator(1)}/posts", TimelineHelper.TextPostCreateRequest(mockContent));
body.Content.Should().BeEquivalentTo(TimelineHelper.TextPostContent(mockContent));
body.Author.Should().BeEquivalentTo(await client.GetUserAsync("user1"));
body.Deleted.Should().BeFalse();
createRes = body;
}
{
- var body = await client.TestGetAsync<List<TimelinePostInfo>>($"timelines/{generator(1)}/posts");
+ var body = await client.TestGetAsync<List<HttpTimelinePost>>($"timelines/{generator(1)}/posts");
body.Should().BeEquivalentTo(createRes);
}
const string mockContent2 = "bbb";
var mockTime2 = DateTime.UtcNow.AddDays(-1);
- TimelinePostInfo createRes2;
+ HttpTimelinePost createRes2;
{
- var body = await client.TestPostAsync<TimelinePostInfo>($"timelines/{generator(1)}/posts", TimelineHelper.TextPostCreateRequest(mockContent2, mockTime2));
+ var body = await client.TestPostAsync<HttpTimelinePost>($"timelines/{generator(1)}/posts", TimelineHelper.TextPostCreateRequest(mockContent2, mockTime2));
body.Should().NotBeNull();
body.Content.Should().BeEquivalentTo(TimelineHelper.TextPostContent(mockContent2));
body.Author.Should().BeEquivalentTo(await client.GetUserAsync("user1"));
@@ -545,7 +545,7 @@ namespace Timeline.Tests.IntegratedTests
createRes2 = body;
}
{
- var body = await client.TestGetAsync<List<TimelinePostInfo>>($"timelines/{generator(1)}/posts");
+ var body = await client.TestGetAsync<List<HttpTimelinePost>>($"timelines/{generator(1)}/posts");
body.Should().BeEquivalentTo(createRes, createRes2);
}
{
@@ -554,7 +554,7 @@ namespace Timeline.Tests.IntegratedTests
await client.TestDeleteAsync($"timelines/{generator(1)}/posts/30000", false);
}
{
- var body = await client.TestGetAsync<List<TimelinePostInfo>>($"timelines/{generator(1)}/posts");
+ var body = await client.TestGetAsync<List<HttpTimelinePost>>($"timelines/{generator(1)}/posts");
body.Should().BeEquivalentTo(createRes2);
}
}
@@ -567,7 +567,7 @@ namespace Timeline.Tests.IntegratedTests
async Task<long> CreatePost(DateTime time)
{
- var body = await client.TestPostAsync<TimelinePostInfo>($"timelines/{generator(1)}/posts", TimelineHelper.TextPostCreateRequest("aaa", time));
+ var body = await client.TestPostAsync<HttpTimelinePost>($"timelines/{generator(1)}/posts", TimelineHelper.TextPostCreateRequest("aaa", time));
return body.Id;
}
@@ -577,7 +577,7 @@ namespace Timeline.Tests.IntegratedTests
var id2 = await CreatePost(now);
{
- var body = await client.TestGetAsync<List<TimelinePostInfo>>($"timelines/{generator(1)}/posts");
+ var body = await client.TestGetAsync<List<HttpTimelinePost>>($"timelines/{generator(1)}/posts");
body.Select(p => p.Id).Should().Equal(id1, id2, id0);
}
}
@@ -588,15 +588,15 @@ namespace Timeline.Tests.IntegratedTests
{
using var client = await CreateClientAsUser();
var postUrl = $"timelines/{generator(1)}/posts";
- await client.TestPostAssertInvalidModelAsync(postUrl, new TimelinePostCreateRequest { Content = null! });
- await client.TestPostAssertInvalidModelAsync(postUrl, new TimelinePostCreateRequest { Content = new TimelinePostCreateRequestContent { Type = null! } });
- await client.TestPostAssertInvalidModelAsync(postUrl, new TimelinePostCreateRequest { Content = new TimelinePostCreateRequestContent { Type = "hahaha" } });
- await client.TestPostAssertInvalidModelAsync(postUrl, new TimelinePostCreateRequest { Content = new TimelinePostCreateRequestContent { Type = "text", Text = null } });
- await client.TestPostAssertInvalidModelAsync(postUrl, new TimelinePostCreateRequest { Content = new TimelinePostCreateRequestContent { Type = "image", Data = null } });
+ await client.TestPostAssertInvalidModelAsync(postUrl, new HttpTimelinePostCreateRequest { Content = null! });
+ await client.TestPostAssertInvalidModelAsync(postUrl, new HttpTimelinePostCreateRequest { Content = new HttpTimelinePostCreateRequestContent { Type = null! } });
+ await client.TestPostAssertInvalidModelAsync(postUrl, new HttpTimelinePostCreateRequest { Content = new HttpTimelinePostCreateRequestContent { Type = "hahaha" } });
+ await client.TestPostAssertInvalidModelAsync(postUrl, new HttpTimelinePostCreateRequest { Content = new HttpTimelinePostCreateRequestContent { Type = "text", Text = null } });
+ await client.TestPostAssertInvalidModelAsync(postUrl, new HttpTimelinePostCreateRequest { Content = new HttpTimelinePostCreateRequestContent { Type = "image", Data = null } });
// image not base64
- await client.TestPostAssertInvalidModelAsync(postUrl, new TimelinePostCreateRequest { Content = new TimelinePostCreateRequestContent { Type = "image", Data = "!!!" } });
+ await client.TestPostAssertInvalidModelAsync(postUrl, new HttpTimelinePostCreateRequest { Content = new HttpTimelinePostCreateRequestContent { Type = "image", Data = "!!!" } });
// image base64 not image
- await client.TestPostAssertInvalidModelAsync(postUrl, new TimelinePostCreateRequest { Content = new TimelinePostCreateRequestContent { Type = "image", Data = Convert.ToBase64String(new byte[] { 0x01, 0x02, 0x03 }) } });
+ await client.TestPostAssertInvalidModelAsync(postUrl, new HttpTimelinePostCreateRequest { Content = new HttpTimelinePostCreateRequestContent { Type = "image", Data = Convert.ToBase64String(new byte[] { 0x01, 0x02, 0x03 }) } });
}
[Theory]
@@ -608,7 +608,7 @@ namespace Timeline.Tests.IntegratedTests
long postId;
string postImageUrl;
- void AssertPostContent(TimelinePostContentInfo content)
+ void AssertPostContent(HttpTimelinePostContent content)
{
content.Type.Should().Be(TimelinePostContentTypes.Image);
content.Url.Should().EndWith($"timelines/{generator(1)}/posts/{postId}/data");
@@ -618,10 +618,10 @@ namespace Timeline.Tests.IntegratedTests
using var client = await CreateClientAsUser();
{
- var body = await client.TestPostAsync<TimelinePostInfo>($"timelines/{generator(1)}/posts",
- new TimelinePostCreateRequest
+ var body = await client.TestPostAsync<HttpTimelinePost>($"timelines/{generator(1)}/posts",
+ new HttpTimelinePostCreateRequest
{
- Content = new TimelinePostCreateRequestContent
+ Content = new HttpTimelinePostCreateRequestContent
{
Type = TimelinePostContentTypes.Image,
Data = Convert.ToBase64String(imageData)
@@ -633,7 +633,7 @@ namespace Timeline.Tests.IntegratedTests
}
{
- var body = await client.TestGetAsync<List<TimelinePostInfo>>($"timelines/{generator(1)}/posts");
+ var body = await client.TestGetAsync<List<HttpTimelinePost>>($"timelines/{generator(1)}/posts");
body.Should().HaveCount(1);
var post = body[0];
post.Id.Should().Be(postId);
@@ -655,7 +655,7 @@ namespace Timeline.Tests.IntegratedTests
await client.TestDeleteAsync($"timelines/{generator(1)}/posts/{postId}", false);
{
- var body = await client.TestGetAsync<List<TimelinePostInfo>>($"timelines/{generator(1)}/posts");
+ var body = await client.TestGetAsync<List<HttpTimelinePost>>($"timelines/{generator(1)}/posts");
body.Should().BeEmpty();
}
@@ -677,7 +677,7 @@ namespace Timeline.Tests.IntegratedTests
long postId;
{
- var body = await client.TestPostAsync<TimelinePostInfo>($"timelines/{generator(1)}/posts", TimelineHelper.TextPostCreateRequest("aaa"));
+ var body = await client.TestPostAsync<HttpTimelinePost>($"timelines/{generator(1)}/posts", TimelineHelper.TextPostCreateRequest("aaa"));
postId = body.Id;
}
@@ -726,12 +726,12 @@ namespace Timeline.Tests.IntegratedTests
using var client = await CreateClientAsUser();
var postContentList = new List<string> { "a", "b", "c", "d" };
- var posts = new List<TimelinePostInfo>();
+ var posts = new List<HttpTimelinePost>();
foreach (var content in postContentList)
{
- var post = await client.TestPostAsync<TimelinePostInfo>($"timelines/{generator(1)}/posts",
- new TimelinePostCreateRequest { Content = new TimelinePostCreateRequestContent { Text = content, Type = TimelinePostContentTypes.Text } });
+ var post = await client.TestPostAsync<HttpTimelinePost>($"timelines/{generator(1)}/posts",
+ new HttpTimelinePostCreateRequest { Content = new HttpTimelinePostCreateRequestContent { Text = content, Type = TimelinePostContentTypes.Text } });
posts.Add(post);
await Task.Delay(1000);
}
@@ -739,7 +739,7 @@ namespace Timeline.Tests.IntegratedTests
await client.TestDeleteAsync($"timelines/{generator(1)}/posts/{posts[2].Id}", true);
{
- var body = await client.TestGetAsync<List<TimelinePostInfo>>($"timelines/{generator(1)}/posts?modifiedSince={posts[1].LastUpdated.ToString("s", CultureInfo.InvariantCulture) }");
+ var body = await client.TestGetAsync<List<HttpTimelinePost>>($"timelines/{generator(1)}/posts?modifiedSince={posts[1].LastUpdated.ToString("s", CultureInfo.InvariantCulture) }");
body.Should().HaveCount(2)
.And.Subject.Select(p => p.Content!.Text).Should().Equal("b", "d");
}
@@ -752,12 +752,12 @@ namespace Timeline.Tests.IntegratedTests
using var client = await CreateClientAsUser();
var postContentList = new List<string> { "a", "b", "c", "d" };
- var posts = new List<TimelinePostInfo>();
+ var posts = new List<HttpTimelinePost>();
foreach (var content in postContentList)
{
- var body = await client.TestPostAsync<TimelinePostInfo>($"timelines/{generator(1)}/posts",
- new TimelinePostCreateRequest { Content = new TimelinePostCreateRequestContent { Text = content, Type = TimelinePostContentTypes.Text } });
+ var body = await client.TestPostAsync<HttpTimelinePost>($"timelines/{generator(1)}/posts",
+ new HttpTimelinePostCreateRequest { Content = new HttpTimelinePostCreateRequestContent { Text = content, Type = TimelinePostContentTypes.Text } });
posts.Add(body);
}
@@ -767,7 +767,7 @@ namespace Timeline.Tests.IntegratedTests
}
{
- posts = await client.TestGetAsync<List<TimelinePostInfo>>($"timelines/{generator(1)}/posts?includeDeleted=true");
+ posts = await client.TestGetAsync<List<HttpTimelinePost>>($"timelines/{generator(1)}/posts?includeDeleted=true");
posts.Should().HaveCount(4);
posts.Select(p => p.Deleted).Should().Equal(true, false, true, false);
posts.Select(p => p.Content == null).Should().Equal(true, false, true, false);
@@ -781,12 +781,12 @@ namespace Timeline.Tests.IntegratedTests
using var client = await CreateClientAsUser();
var postContentList = new List<string> { "a", "b", "c", "d" };
- var posts = new List<TimelinePostInfo>();
+ var posts = new List<HttpTimelinePost>();
foreach (var (content, index) in postContentList.Select((v, i) => (v, i)))
{
- var post = await client.TestPostAsync<TimelinePostInfo>($"timelines/{generator(1)}/posts",
- new TimelinePostCreateRequest { Content = new TimelinePostCreateRequestContent { Text = content, Type = TimelinePostContentTypes.Text } });
+ var post = await client.TestPostAsync<HttpTimelinePost>($"timelines/{generator(1)}/posts",
+ new HttpTimelinePostCreateRequest { Content = new HttpTimelinePostCreateRequestContent { Text = content, Type = TimelinePostContentTypes.Text } });
posts.Add(post);
await Task.Delay(1000);
}
@@ -795,7 +795,7 @@ namespace Timeline.Tests.IntegratedTests
{
- posts = await client.TestGetAsync<List<TimelinePostInfo>>($"timelines/{generator(1)}/posts?modifiedSince={posts[1].LastUpdated.ToString("s", CultureInfo.InvariantCulture)}&includeDeleted=true");
+ posts = await client.TestGetAsync<List<HttpTimelinePost>>($"timelines/{generator(1)}/posts?modifiedSince={posts[1].LastUpdated.ToString("s", CultureInfo.InvariantCulture)}&includeDeleted=true");
posts.Should().HaveCount(3);
posts.Select(p => p.Deleted).Should().Equal(false, true, false);
posts.Select(p => p.Content == null).Should().Equal(false, true, false);
@@ -809,7 +809,7 @@ namespace Timeline.Tests.IntegratedTests
using var client = await CreateClientAsUser();
DateTime lastModifiedTime;
- TimelineInfo timeline;
+ HttpTimeline timeline;
string uniqueId;
{
@@ -830,7 +830,7 @@ namespace Timeline.Tests.IntegratedTests
{
- var body = await client.TestGetAsync<TimelineInfo>($"timelines/{generator(1)}",
+ var body = await client.TestGetAsync<HttpTimeline>($"timelines/{generator(1)}",
headerSetup: (headers, _) =>
{
headers.IfModifiedSince = lastModifiedTime.AddSeconds(-1);
@@ -843,7 +843,7 @@ namespace Timeline.Tests.IntegratedTests
}
{
- var body = await client.TestGetAsync<TimelineInfo>($"timelines/{generator(1)}?ifModifiedSince={lastModifiedTime.AddSeconds(-1).ToString("s", CultureInfo.InvariantCulture) }");
+ var body = await client.TestGetAsync<HttpTimeline>($"timelines/{generator(1)}?ifModifiedSince={lastModifiedTime.AddSeconds(-1).ToString("s", CultureInfo.InvariantCulture) }");
body.Should().BeEquivalentTo(timeline);
}
@@ -853,7 +853,7 @@ namespace Timeline.Tests.IntegratedTests
{
var testUniqueId = (uniqueId[0] == 'a' ? "b" : "a") + uniqueId[1..];
- var body = await client.TestGetAsync<TimelineInfo>($"timelines/{generator(1)}?ifModifiedSince={lastModifiedTime.AddSeconds(1).ToString("s", CultureInfo.InvariantCulture) }&checkUniqueId={testUniqueId}");
+ var body = await client.TestGetAsync<HttpTimeline>($"timelines/{generator(1)}?ifModifiedSince={lastModifiedTime.AddSeconds(1).ToString("s", CultureInfo.InvariantCulture) }&checkUniqueId={testUniqueId}");
body.Should().BeEquivalentTo(timeline);
}
}
@@ -870,7 +870,7 @@ namespace Timeline.Tests.IntegratedTests
}
{
- var body = await client.PatchTimelineAsync(generator(1), new TimelinePatchRequest { Title = "atitle" });
+ var body = await client.PatchTimelineAsync(generator(1), new HttpTimelinePatchRequest { Title = "atitle" });
body.Title.Should().Be("atitle");
}
@@ -885,26 +885,26 @@ namespace Timeline.Tests.IntegratedTests
{
{
using var client = await CreateDefaultClient();
- await client.TestPostAssertUnauthorizedAsync("timelineop/changename", new TimelineChangeNameRequest { OldName = "t1", NewName = "tttttttt" });
+ await client.TestPostAssertUnauthorizedAsync("timelineop/changename", new HttpTimelineChangeNameRequest { OldName = "t1", NewName = "tttttttt" });
}
{
using var client = await CreateClientAs(2);
- await client.TestPostAssertForbiddenAsync("timelineop/changename", new TimelineChangeNameRequest { OldName = "t1", NewName = "tttttttt" });
+ await client.TestPostAssertForbiddenAsync("timelineop/changename", new HttpTimelineChangeNameRequest { OldName = "t1", NewName = "tttttttt" });
}
using (var client = await CreateClientAsUser())
{
- await client.TestPostAssertInvalidModelAsync("timelineop/changename", new TimelineChangeNameRequest { OldName = "!!!", NewName = "tttttttt" });
- await client.TestPostAssertInvalidModelAsync("timelineop/changename", new TimelineChangeNameRequest { OldName = "ttt", NewName = "!!!!" });
- await client.TestPostAssertErrorAsync("timelineop/changename", new TimelineChangeNameRequest { OldName = "ttttt", NewName = "tttttttt" }, errorCode: ErrorCodes.TimelineController.NotExist);
+ await client.TestPostAssertInvalidModelAsync("timelineop/changename", new HttpTimelineChangeNameRequest { OldName = "!!!", NewName = "tttttttt" });
+ await client.TestPostAssertInvalidModelAsync("timelineop/changename", new HttpTimelineChangeNameRequest { OldName = "ttt", NewName = "!!!!" });
+ await client.TestPostAssertErrorAsync("timelineop/changename", new HttpTimelineChangeNameRequest { OldName = "ttttt", NewName = "tttttttt" }, errorCode: ErrorCodes.TimelineController.NotExist);
- await client.TestPostAsync("timelineop/changename", new TimelineChangeNameRequest { OldName = "t1", NewName = "newt" });
+ await client.TestPostAsync("timelineop/changename", new HttpTimelineChangeNameRequest { OldName = "t1", NewName = "newt" });
await client.TestGetAsync("timelines/t1", expectedStatusCode: HttpStatusCode.NotFound);
{
- var body = await client.TestGetAsync<TimelineInfo>("timelines/newt");
+ var body = await client.TestGetAsync<HttpTimeline>("timelines/newt");
body.Name.Should().Be("newt");
}
}
@@ -920,9 +920,9 @@ namespace Timeline.Tests.IntegratedTests
string etag;
{
- var body = await client.TestPostAsync<TimelinePostInfo>($"timelines/{generator(1)}/posts", new TimelinePostCreateRequest
+ var body = await client.TestPostAsync<HttpTimelinePost>($"timelines/{generator(1)}/posts", new HttpTimelinePostCreateRequest
{
- Content = new TimelinePostCreateRequestContent
+ Content = new HttpTimelinePostCreateRequestContent
{
Type = TimelinePostContentTypes.Image,
Data = Convert.ToBase64String(ImageHelper.CreatePngWithSize(100, 50))
diff --git a/BackEnd/Timeline.Tests/IntegratedTests/TokenTest.cs b/BackEnd/Timeline.Tests/IntegratedTests/TokenTest.cs
index a5208618..fdf1af99 100644
--- a/BackEnd/Timeline.Tests/IntegratedTests/TokenTest.cs
+++ b/BackEnd/Timeline.Tests/IntegratedTests/TokenTest.cs
@@ -14,9 +14,9 @@ namespace Timeline.Tests.IntegratedTests
private const string CreateTokenUrl = "token/create";
private const string VerifyTokenUrl = "token/verify";
- private static async Task<CreateTokenResponse> CreateUserTokenAsync(HttpClient client, string username, string password, int? expireOffset = null)
+ private static async Task<HttpCreateTokenResponse> CreateUserTokenAsync(HttpClient client, string username, string password, int? expireOffset = null)
{
- return await client.TestPostAsync<CreateTokenResponse>(CreateTokenUrl, new CreateTokenRequest { Username = username, Password = password, Expire = expireOffset });
+ return await client.TestPostAsync<HttpCreateTokenResponse>(CreateTokenUrl, new HttpCreateTokenRequest { Username = username, Password = password, Expire = expireOffset });
}
public static IEnumerable<object?[]> CreateToken_InvalidModel_Data()
@@ -32,7 +32,7 @@ namespace Timeline.Tests.IntegratedTests
public async Task CreateToken_InvalidModel(string username, string password, int expire)
{
using var client = await CreateDefaultClient();
- await client.TestPostAssertInvalidModelAsync(CreateTokenUrl, new CreateTokenRequest
+ await client.TestPostAssertInvalidModelAsync(CreateTokenUrl, new HttpCreateTokenRequest
{
Username = username,
Password = password,
@@ -52,7 +52,7 @@ namespace Timeline.Tests.IntegratedTests
{
using var client = await CreateDefaultClient();
await client.TestPostAssertErrorAsync(CreateTokenUrl,
- new CreateTokenRequest { Username = username, Password = password },
+ new HttpCreateTokenRequest { Username = username, Password = password },
errorCode: ErrorCodes.TokenController.Create_BadCredential);
}
@@ -60,8 +60,8 @@ namespace Timeline.Tests.IntegratedTests
public async Task CreateToken_Success()
{
using var client = await CreateDefaultClient();
- var body = await client.TestPostAsync<CreateTokenResponse>(CreateTokenUrl,
- new CreateTokenRequest { Username = "user1", Password = "user1pw" });
+ var body = await client.TestPostAsync<HttpCreateTokenResponse>(CreateTokenUrl,
+ new HttpCreateTokenRequest { Username = "user1", Password = "user1pw" });
body.Token.Should().NotBeNullOrWhiteSpace();
body.User.Should().BeEquivalentTo(await client.GetUserAsync("user1"));
}
@@ -70,7 +70,7 @@ namespace Timeline.Tests.IntegratedTests
public async Task VerifyToken_InvalidModel()
{
using var client = await CreateDefaultClient();
- await client.TestPostAssertInvalidModelAsync(VerifyTokenUrl, new VerifyTokenRequest { Token = null! });
+ await client.TestPostAssertInvalidModelAsync(VerifyTokenUrl, new HttpVerifyTokenRequest { Token = null! });
}
[Fact]
@@ -78,7 +78,7 @@ namespace Timeline.Tests.IntegratedTests
{
using var client = await CreateDefaultClient();
await client.TestPostAssertErrorAsync(VerifyTokenUrl,
- new VerifyTokenRequest { Token = "bad token hahaha" },
+ new HttpVerifyTokenRequest { Token = "bad token hahaha" },
errorCode: ErrorCodes.TokenController.Verify_BadFormat);
}
@@ -97,7 +97,7 @@ namespace Timeline.Tests.IntegratedTests
}
await client.TestPostAssertErrorAsync(VerifyTokenUrl,
- new VerifyTokenRequest { Token = token },
+ new HttpVerifyTokenRequest { Token = token },
errorCode: ErrorCodes.TokenController.Verify_OldVersion);
}
@@ -114,7 +114,7 @@ namespace Timeline.Tests.IntegratedTests
}
await client.TestPostAssertErrorAsync(VerifyTokenUrl,
- new VerifyTokenRequest { Token = token },
+ new HttpVerifyTokenRequest { Token = token },
errorCode: ErrorCodes.TokenController.Verify_UserNotExist);
}
@@ -141,8 +141,8 @@ namespace Timeline.Tests.IntegratedTests
{
using var client = await CreateDefaultClient();
var createTokenResult = await CreateUserTokenAsync(client, "user1", "user1pw");
- var body = await client.TestPostAsync<VerifyTokenResponse>(VerifyTokenUrl,
- new VerifyTokenRequest { Token = createTokenResult.Token });
+ var body = await client.TestPostAsync<HttpVerifyTokenResponse>(VerifyTokenUrl,
+ new HttpVerifyTokenRequest { Token = createTokenResult.Token });
body.User.Should().BeEquivalentTo(await client.GetUserAsync("user1"));
}
}
diff --git a/BackEnd/Timeline.Tests/IntegratedTests/UserTest.cs b/BackEnd/Timeline.Tests/IntegratedTests/UserTest.cs
index e0ebf635..56dbf92a 100644
--- a/BackEnd/Timeline.Tests/IntegratedTests/UserTest.cs
+++ b/BackEnd/Timeline.Tests/IntegratedTests/UserTest.cs
@@ -12,7 +12,7 @@ namespace Timeline.Tests.IntegratedTests
public async Task UserListShouldHaveUniqueId()
{
using var client = await CreateDefaultClient();
- foreach (var user in await client.TestGetAsync<List<UserInfo>>("users"))
+ foreach (var user in await client.TestGetAsync<List<HttpUser>>("users"))
{
user.UniqueId.Should().NotBeNullOrWhiteSpace();
}
@@ -22,14 +22,14 @@ namespace Timeline.Tests.IntegratedTests
public async Task GetList()
{
using var client = await CreateDefaultClient();
- await client.TestGetAsync<List<UserInfo>>("users");
+ await client.TestGetAsync<List<HttpUser>>("users");
}
[Fact]
public async Task Get()
{
using var client = await CreateDefaultClient();
- var user = await client.TestGetAsync<UserInfo>($"users/admin");
+ var user = await client.TestGetAsync<HttpUser>($"users/admin");
user.Username.Should().Be("admin");
user.Nickname.Should().Be("administrator");
user.UniqueId.Should().NotBeNullOrEmpty();
@@ -55,8 +55,8 @@ namespace Timeline.Tests.IntegratedTests
{
using var client = await CreateClientAsUser();
{
- var body = await client.TestPatchAsync<UserInfo>("users/user1",
- new UserPatchRequest { Nickname = "aaa" });
+ var body = await client.TestPatchAsync<HttpUser>("users/user1",
+ new HttpUserPatchRequest { Nickname = "aaa" });
body.Nickname.Should().Be("aaa");
}
@@ -73,8 +73,8 @@ namespace Timeline.Tests.IntegratedTests
using var userClient = await CreateClientAsUser();
{
- var body = await client.TestPatchAsync<UserInfo>("users/user1",
- new UserPatchRequest
+ var body = await client.TestPatchAsync<HttpUser>("users/user1",
+ new HttpUserPatchRequest
{
Username = "newuser",
Password = "newpw",
@@ -91,7 +91,7 @@ namespace Timeline.Tests.IntegratedTests
{
var token = userClient.DefaultRequestHeaders.Authorization!.Parameter!;
// Token should expire.
- await userClient.TestPostAssertErrorAsync("token/verify", new VerifyTokenRequest() { Token = token });
+ await userClient.TestPostAssertErrorAsync("token/verify", new HttpVerifyTokenRequest() { Token = token });
}
{
@@ -104,26 +104,26 @@ namespace Timeline.Tests.IntegratedTests
public async Task Patch_NotExist()
{
using var client = await CreateClientAsAdministrator();
- await client.TestPatchAssertNotFoundAsync("users/usernotexist", new UserPatchRequest { }, errorCode: ErrorCodes.UserCommon.NotExist);
+ await client.TestPatchAssertNotFoundAsync("users/usernotexist", new HttpUserPatchRequest { }, errorCode: ErrorCodes.UserCommon.NotExist);
}
[Fact]
public async Task Patch_InvalidModel()
{
using var client = await CreateClientAsAdministrator();
- await client.TestPatchAssertInvalidModelAsync("users/aaa!a", new UserPatchRequest { });
+ await client.TestPatchAssertInvalidModelAsync("users/aaa!a", new HttpUserPatchRequest { });
}
public static IEnumerable<object[]> Patch_InvalidModel_Body_Data()
{
- yield return new[] { new UserPatchRequest { Username = "aaa!a" } };
- yield return new[] { new UserPatchRequest { Password = "" } };
- yield return new[] { new UserPatchRequest { Nickname = new string('a', 50) } };
+ yield return new[] { new HttpUserPatchRequest { Username = "aaa!a" } };
+ yield return new[] { new HttpUserPatchRequest { Password = "" } };
+ yield return new[] { new HttpUserPatchRequest { Nickname = new string('a', 50) } };
}
[Theory]
[MemberData(nameof(Patch_InvalidModel_Body_Data))]
- public async Task Patch_InvalidModel_Body(UserPatchRequest body)
+ public async Task Patch_InvalidModel_Body(HttpUserPatchRequest body)
{
using var client = await CreateClientAsAdministrator();
await client.TestPatchAssertInvalidModelAsync("users/user1", body);
@@ -133,35 +133,35 @@ namespace Timeline.Tests.IntegratedTests
public async Task Patch_UsernameConflict()
{
using var client = await CreateClientAsAdministrator();
- await client.TestPatchAssertErrorAsync("users/user1", new UserPatchRequest { Username = "admin" }, errorCode: ErrorCodes.UserController.UsernameConflict);
+ await client.TestPatchAssertErrorAsync("users/user1", new HttpUserPatchRequest { Username = "admin" }, errorCode: ErrorCodes.UserController.UsernameConflict);
}
[Fact]
public async Task Patch_NoAuth_Unauthorized()
{
using var client = await CreateDefaultClient();
- await client.TestPatchAssertUnauthorizedAsync("users/user1", new UserPatchRequest { Nickname = "aaa" });
+ await client.TestPatchAssertUnauthorizedAsync("users/user1", new HttpUserPatchRequest { Nickname = "aaa" });
}
[Fact]
public async Task Patch_User_Forbid()
{
using var client = await CreateClientAsUser();
- await client.TestPatchAssertForbiddenAsync("users/admin", new UserPatchRequest { Nickname = "aaa" });
+ await client.TestPatchAssertForbiddenAsync("users/admin", new HttpUserPatchRequest { Nickname = "aaa" });
}
[Fact]
public async Task Patch_Username_Forbid()
{
using var client = await CreateClientAsUser();
- await client.TestPatchAssertForbiddenAsync("users/user1", new UserPatchRequest { Username = "aaa" });
+ await client.TestPatchAssertForbiddenAsync("users/user1", new HttpUserPatchRequest { Username = "aaa" });
}
[Fact]
public async Task Patch_Password_Forbid()
{
using var client = await CreateClientAsUser();
- await client.TestPatchAssertForbiddenAsync("users/user1", new UserPatchRequest { Password = "aaa" });
+ await client.TestPatchAssertForbiddenAsync("users/user1", new HttpUserPatchRequest { Password = "aaa" });
}
[Fact]
@@ -214,7 +214,7 @@ namespace Timeline.Tests.IntegratedTests
{
using var client = await CreateClientAsAdministrator();
{
- var body = await client.TestPostAsync<UserInfo>(createUserUrl, new CreateUserRequest
+ var body = await client.TestPostAsync<HttpUser>(createUserUrl, new HttpCreateUserRequest
{
Username = "aaa",
Password = "bbb",
@@ -233,15 +233,15 @@ namespace Timeline.Tests.IntegratedTests
public static IEnumerable<object[]> Op_CreateUser_InvalidModel_Data()
{
- yield return new[] { new CreateUserRequest { Username = "aaa" } };
- yield return new[] { new CreateUserRequest { Password = "bbb" } };
- yield return new[] { new CreateUserRequest { Username = "a!a", Password = "bbb" } };
- yield return new[] { new CreateUserRequest { Username = "aaa", Password = "" } };
+ yield return new[] { new HttpCreateUserRequest { Username = "aaa" } };
+ yield return new[] { new HttpCreateUserRequest { Password = "bbb" } };
+ yield return new[] { new HttpCreateUserRequest { Username = "a!a", Password = "bbb" } };
+ yield return new[] { new HttpCreateUserRequest { Username = "aaa", Password = "" } };
}
[Theory]
[MemberData(nameof(Op_CreateUser_InvalidModel_Data))]
- public async Task Op_CreateUser_InvalidModel(CreateUserRequest body)
+ public async Task Op_CreateUser_InvalidModel(HttpCreateUserRequest body)
{
using var client = await CreateClientAsAdministrator();
await client.TestPostAssertInvalidModelAsync(createUserUrl, body);
@@ -251,7 +251,7 @@ namespace Timeline.Tests.IntegratedTests
public async Task Op_CreateUser_UsernameConflict()
{
using var client = await CreateClientAsAdministrator();
- await client.TestPostAssertErrorAsync(createUserUrl, new CreateUserRequest
+ await client.TestPostAssertErrorAsync(createUserUrl, new HttpCreateUserRequest
{
Username = "user1",
Password = "bbb",
@@ -262,7 +262,7 @@ namespace Timeline.Tests.IntegratedTests
public async Task Op_CreateUser_NoAuth_Unauthorized()
{
using var client = await CreateDefaultClient();
- await client.TestPostAssertUnauthorizedAsync(createUserUrl, new CreateUserRequest
+ await client.TestPostAssertUnauthorizedAsync(createUserUrl, new HttpCreateUserRequest
{
Username = "aaa",
Password = "bbb",
@@ -273,7 +273,7 @@ namespace Timeline.Tests.IntegratedTests
public async Task Op_CreateUser_User_Forbid()
{
using var client = await CreateClientAsUser();
- await client.TestPostAssertForbiddenAsync(createUserUrl, new CreateUserRequest
+ await client.TestPostAssertForbiddenAsync(createUserUrl, new HttpCreateUserRequest
{
Username = "aaa",
Password = "bbb",
@@ -286,8 +286,8 @@ namespace Timeline.Tests.IntegratedTests
public async Task Op_ChangePassword()
{
using var client = await CreateClientAsUser();
- await client.TestPostAsync(changePasswordUrl, new ChangePasswordRequest { OldPassword = "user1pw", NewPassword = "newpw" });
- await client.TestPatchAssertUnauthorizedAsync("users/user1", new UserPatchRequest { });
+ await client.TestPostAsync(changePasswordUrl, new HttpChangePasswordRequest { OldPassword = "user1pw", NewPassword = "newpw" });
+ await client.TestPatchAssertUnauthorizedAsync("users/user1", new HttpUserPatchRequest { });
(await CreateClientWithCredential("user1", "newpw")).Dispose();
}
@@ -303,21 +303,21 @@ namespace Timeline.Tests.IntegratedTests
{
using var client = await CreateClientAsUser();
await client.TestPostAssertInvalidModelAsync(changePasswordUrl,
- new ChangePasswordRequest { OldPassword = oldPassword, NewPassword = newPassword });
+ new HttpChangePasswordRequest { OldPassword = oldPassword, NewPassword = newPassword });
}
[Fact]
public async Task Op_ChangePassword_BadOldPassword()
{
using var client = await CreateClientAsUser();
- await client.TestPostAssertErrorAsync(changePasswordUrl, new ChangePasswordRequest { OldPassword = "???", NewPassword = "???" }, errorCode: ErrorCodes.UserController.ChangePassword_BadOldPassword);
+ await client.TestPostAssertErrorAsync(changePasswordUrl, new HttpChangePasswordRequest { OldPassword = "???", NewPassword = "???" }, errorCode: ErrorCodes.UserController.ChangePassword_BadOldPassword);
}
[Fact]
public async Task Op_ChangePassword_NoAuth_Unauthorized()
{
using var client = await CreateDefaultClient();
- await client.TestPostAssertUnauthorizedAsync(changePasswordUrl, new ChangePasswordRequest { OldPassword = "???", NewPassword = "???" });
+ await client.TestPostAssertUnauthorizedAsync(changePasswordUrl, new HttpChangePasswordRequest { OldPassword = "???", NewPassword = "???" });
}
}
}
diff --git a/BackEnd/Timeline.Tests/Services/HighlightTimelineServiceTest.cs b/BackEnd/Timeline.Tests/Services/HighlightTimelineServiceTest.cs
new file mode 100644
index 00000000..8ba26613
--- /dev/null
+++ b/BackEnd/Timeline.Tests/Services/HighlightTimelineServiceTest.cs
@@ -0,0 +1,43 @@
+using FluentAssertions;
+using Microsoft.Extensions.Logging.Abstractions;
+using System.Threading.Tasks;
+using Timeline.Services;
+using Timeline.Tests.Helpers;
+using Xunit;
+
+namespace Timeline.Tests.Services
+{
+ public class HighlightTimelineServiceTest : DatabaseBasedTest
+ {
+ private readonly TestClock _clock = new TestClock();
+ private UserService _userService = default!;
+ private TimelineService _timelineService = default!;
+
+ private HighlightTimelineService _service = default!;
+
+ protected override void OnDatabaseCreated()
+ {
+ _userService = new UserService(NullLogger<UserService>.Instance, Database, new PasswordService(), new UserPermissionService(Database), _clock);
+ _timelineService = new TimelineService(Database, _userService, _clock);
+ _service = new HighlightTimelineService(Database, _userService, _timelineService, _clock);
+ }
+
+ [Fact]
+ public async Task Should_Work()
+ {
+ {
+ var ht = await _service.GetHighlightTimelines();
+ ht.Should().BeEmpty();
+ }
+
+ var userId = await _userService.GetUserIdByUsername("user");
+ await _timelineService.CreateTimeline("tl", userId);
+ await _service.AddHighlightTimeline("tl", userId);
+
+ {
+ var ht = await _service.GetHighlightTimelines();
+ ht.Should().HaveCount(1).And.BeEquivalentTo(await _timelineService.GetTimeline("tl"));
+ }
+ }
+ }
+}
diff --git a/BackEnd/Timeline.Tests/Services/TimelinePostServiceTest.cs b/BackEnd/Timeline.Tests/Services/TimelinePostServiceTest.cs
new file mode 100644
index 00000000..7771ae0b
--- /dev/null
+++ b/BackEnd/Timeline.Tests/Services/TimelinePostServiceTest.cs
@@ -0,0 +1,200 @@
+using FluentAssertions;
+using Microsoft.Extensions.Logging.Abstractions;
+using System;
+using System.Linq;
+using System.Threading.Tasks;
+using Timeline.Models;
+using Timeline.Services;
+using Timeline.Tests.Helpers;
+using Xunit;
+
+namespace Timeline.Tests.Services
+{
+ public class TimelinePostServiceTest : DatabaseBasedTest
+ {
+ private readonly PasswordService _passwordService = new PasswordService();
+
+ private readonly ETagGenerator _eTagGenerator = new ETagGenerator();
+
+ private readonly ImageValidator _imageValidator = new ImageValidator();
+
+ private readonly TestClock _clock = new TestClock();
+
+ private DataManager _dataManager = default!;
+
+ private UserPermissionService _userPermissionService = default!;
+
+ private UserService _userService = default!;
+
+ private TimelineService _timelineService = default!;
+
+ private TimelinePostService _timelinePostService = default!;
+
+ private UserDeleteService _userDeleteService = default!;
+
+ protected override void OnDatabaseCreated()
+ {
+ _dataManager = new DataManager(Database, _eTagGenerator);
+ _userPermissionService = new UserPermissionService(Database);
+ _userService = new UserService(NullLogger<UserService>.Instance, Database, _passwordService, _userPermissionService, _clock);
+ _timelineService = new TimelineService(Database, _userService, _clock);
+ _timelinePostService = new TimelinePostService(NullLogger<TimelinePostService>.Instance, Database, _timelineService, _userService, _dataManager, _imageValidator, _clock);
+ _userDeleteService = new UserDeleteService(NullLogger<UserDeleteService>.Instance, Database, _timelinePostService);
+ }
+
+ protected override void BeforeDatabaseDestroy()
+ {
+ _eTagGenerator.Dispose();
+ }
+
+ [Theory]
+ [InlineData("@user")]
+ [InlineData("tl")]
+ public async Task GetPosts_ModifiedSince(string timelineName)
+ {
+ _clock.ForwardCurrentTime();
+
+ var userId = await _userService.GetUserIdByUsername("user");
+
+ var _ = TimelineHelper.ExtractTimelineName(timelineName, out var isPersonal);
+ if (!isPersonal)
+ await _timelineService.CreateTimeline(timelineName, userId);
+
+ var postContentList = new string[] { "a", "b", "c", "d" };
+
+ DateTime testPoint = new DateTime();
+
+ foreach (var (content, index) in postContentList.Select((v, i) => (v, i)))
+ {
+ var t = _clock.ForwardCurrentTime();
+ if (index == 1)
+ testPoint = t;
+ await _timelinePostService.CreateTextPost(timelineName, userId, content, null);
+ }
+
+ var posts = await _timelinePostService.GetPosts(timelineName, testPoint);
+ posts.Should().HaveCount(3)
+ .And.Subject.Select(p => ((TextTimelinePostContent)p.Content!).Text).Should().Equal(postContentList.Skip(1));
+ }
+
+ [Theory]
+ [InlineData("@user")]
+ [InlineData("tl")]
+ public async Task GetPosts_IncludeDeleted(string timelineName)
+ {
+ var userId = await _userService.GetUserIdByUsername("user");
+
+ var _ = TimelineHelper.ExtractTimelineName(timelineName, out var isPersonal);
+ if (!isPersonal)
+ await _timelineService.CreateTimeline(timelineName, userId);
+
+ var postContentList = new string[] { "a", "b", "c", "d" };
+
+ foreach (var content in postContentList)
+ {
+ await _timelinePostService.CreateTextPost(timelineName, userId, content, null);
+ }
+
+ var posts = await _timelinePostService.GetPosts(timelineName);
+ posts.Should().HaveCount(4);
+ posts.Select(p => p.Deleted).Should().Equal(Enumerable.Repeat(false, posts.Count));
+ posts.Select(p => ((TextTimelinePostContent)p.Content!).Text).Should().Equal(postContentList);
+
+ foreach (var id in new long[] { posts[0].Id, posts[2].Id })
+ {
+ await _timelinePostService.DeletePost(timelineName, id);
+ }
+
+ posts = await _timelinePostService.GetPosts(timelineName);
+ posts.Should().HaveCount(2);
+ posts.Select(p => p.Deleted).Should().Equal(Enumerable.Repeat(false, posts.Count));
+ posts.Select(p => ((TextTimelinePostContent)p.Content!).Text).Should().Equal(new string[] { "b", "d" });
+
+ posts = await _timelinePostService.GetPosts(timelineName, includeDeleted: true);
+ posts.Should().HaveCount(4);
+ posts.Select(p => p.Deleted).Should().Equal(new bool[] { true, false, true, false });
+ posts.Where(p => !p.Deleted).Select(p => ((TextTimelinePostContent)p.Content!).Text).Should().Equal(new string[] { "b", "d" });
+ }
+
+ [Theory]
+ [InlineData("@admin")]
+ [InlineData("tl")]
+ public async Task GetPosts_ModifiedSince_UsernameChange(string timelineName)
+ {
+ var time1 = _clock.ForwardCurrentTime();
+
+ var userId = await _userService.GetUserIdByUsername("user");
+
+ var _ = TimelineHelper.ExtractTimelineName(timelineName, out var isPersonal);
+ if (!isPersonal)
+ await _timelineService.CreateTimeline(timelineName, userId);
+
+ var postContentList = new string[] { "a", "b", "c", "d" };
+
+ foreach (var (content, index) in postContentList.Select((v, i) => (v, i)))
+ {
+ await _timelinePostService.CreateTextPost(timelineName, userId, content, null);
+ }
+
+ var time2 = _clock.ForwardCurrentTime();
+
+ {
+ var posts = await _timelinePostService.GetPosts(timelineName, time2);
+ posts.Should().HaveCount(0);
+ }
+
+ {
+ await _userService.ModifyUser(userId, new ModifyUserParams { Nickname = "haha" });
+ var posts = await _timelinePostService.GetPosts(timelineName, time2);
+ posts.Should().HaveCount(0);
+ }
+
+ {
+ await _userService.ModifyUser(userId, new ModifyUserParams { Username = "haha" });
+ var posts = await _timelinePostService.GetPosts(timelineName, time2);
+ posts.Should().HaveCount(4);
+ }
+ }
+
+ [Theory]
+ [InlineData("@admin")]
+ [InlineData("tl")]
+ public async Task GetPosts_ModifiedSince_UserDelete(string timelineName)
+ {
+ var time1 = _clock.ForwardCurrentTime();
+
+ var userId = await _userService.GetUserIdByUsername("user");
+ var adminId = await _userService.GetUserIdByUsername("admin");
+
+ var _ = TimelineHelper.ExtractTimelineName(timelineName, out var isPersonal);
+ if (!isPersonal)
+ await _timelineService.CreateTimeline(timelineName, adminId);
+
+ var postContentList = new string[] { "a", "b", "c", "d" };
+
+ foreach (var (content, index) in postContentList.Select((v, i) => (v, i)))
+ {
+ await _timelinePostService.CreateTextPost(timelineName, userId, content, null);
+ }
+
+ var time2 = _clock.ForwardCurrentTime();
+
+ {
+ var posts = await _timelinePostService.GetPosts(timelineName, time2);
+ posts.Should().HaveCount(0);
+ }
+
+ await _userDeleteService.DeleteUser("user");
+
+ {
+ var posts = await _timelinePostService.GetPosts(timelineName, time2);
+ posts.Should().HaveCount(0);
+ }
+
+ {
+ var posts = await _timelinePostService.GetPosts(timelineName, time2, true);
+ posts.Should().HaveCount(4);
+ }
+ }
+ }
+}
diff --git a/BackEnd/Timeline.Tests/Services/TimelineServiceTest.cs b/BackEnd/Timeline.Tests/Services/TimelineServiceTest.cs
index 5f2c20e8..70f54ede 100644
--- a/BackEnd/Timeline.Tests/Services/TimelineServiceTest.cs
+++ b/BackEnd/Timeline.Tests/Services/TimelineServiceTest.cs
@@ -2,7 +2,6 @@
using Microsoft.Extensions.Logging.Abstractions;
using System;
using System.Collections.Generic;
-using System.Linq;
using System.Threading.Tasks;
using Timeline.Models;
using Timeline.Services;
@@ -12,38 +11,23 @@ using Xunit;
namespace Timeline.Tests.Services
{
- public class TimelineServiceTest : DatabaseBasedTest, IDisposable
+ public class TimelineServiceTest : DatabaseBasedTest
{
private readonly PasswordService _passwordService = new PasswordService();
- private readonly ETagGenerator _eTagGenerator = new ETagGenerator();
-
- private readonly ImageValidator _imageValidator = new ImageValidator();
-
private readonly TestClock _clock = new TestClock();
- private DataManager _dataManager = default!;
-
private UserPermissionService _userPermissionService = default!;
private UserService _userService = default!;
private TimelineService _timelineService = default!;
- private UserDeleteService _userDeleteService = default!;
-
protected override void OnDatabaseCreated()
{
- _dataManager = new DataManager(Database, _eTagGenerator);
_userPermissionService = new UserPermissionService(Database);
- _userService = new UserService(NullLogger<UserService>.Instance, Database, _passwordService, _clock, _userPermissionService);
- _timelineService = new TimelineService(NullLogger<TimelineService>.Instance, Database, _dataManager, _userService, _imageValidator, _clock);
- _userDeleteService = new UserDeleteService(NullLogger<UserDeleteService>.Instance, Database, _timelineService);
- }
-
- public void Dispose()
- {
- _eTagGenerator.Dispose();
+ _userService = new UserService(NullLogger<UserService>.Instance, Database, _passwordService, _userPermissionService, _clock);
+ _timelineService = new TimelineService(Database, _userService, _clock);
}
[Theory]
@@ -83,7 +67,7 @@ namespace Timeline.Tests.Services
{
var initTime = _clock.ForwardCurrentTime();
- void Check(Models.Timeline timeline)
+ void Check(TimelineInfo timeline)
{
timeline.NameLastModified.Should().Be(initTime);
timeline.LastModified.Should().Be(_clock.GetCurrentTime());
@@ -110,156 +94,6 @@ namespace Timeline.Tests.Services
}
[Theory]
- [InlineData("@user")]
- [InlineData("tl")]
- public async Task GetPosts_ModifiedSince(string timelineName)
- {
- _clock.ForwardCurrentTime();
-
- var userId = await _userService.GetUserIdByUsername("user");
-
- var _ = TimelineHelper.ExtractTimelineName(timelineName, out var isPersonal);
- if (!isPersonal)
- await _timelineService.CreateTimeline(timelineName, userId);
-
- var postContentList = new string[] { "a", "b", "c", "d" };
-
- DateTime testPoint = new DateTime();
-
- foreach (var (content, index) in postContentList.Select((v, i) => (v, i)))
- {
- var t = _clock.ForwardCurrentTime();
- if (index == 1)
- testPoint = t;
- await _timelineService.CreateTextPost(timelineName, userId, content, null);
- }
-
- var posts = await _timelineService.GetPosts(timelineName, testPoint);
- posts.Should().HaveCount(3)
- .And.Subject.Select(p => ((TextTimelinePostContent)p.Content!).Text).Should().Equal(postContentList.Skip(1));
- }
-
- [Theory]
- [InlineData("@user")]
- [InlineData("tl")]
- public async Task GetPosts_IncludeDeleted(string timelineName)
- {
- var userId = await _userService.GetUserIdByUsername("user");
-
- var _ = TimelineHelper.ExtractTimelineName(timelineName, out var isPersonal);
- if (!isPersonal)
- await _timelineService.CreateTimeline(timelineName, userId);
-
- var postContentList = new string[] { "a", "b", "c", "d" };
-
- foreach (var content in postContentList)
- {
- await _timelineService.CreateTextPost(timelineName, userId, content, null);
- }
-
- var posts = await _timelineService.GetPosts(timelineName);
- posts.Should().HaveCount(4);
- posts.Select(p => p.Deleted).Should().Equal(Enumerable.Repeat(false, posts.Count));
- posts.Select(p => ((TextTimelinePostContent)p.Content!).Text).Should().Equal(postContentList);
-
- foreach (var id in new long[] { posts[0].Id, posts[2].Id })
- {
- await _timelineService.DeletePost(timelineName, id);
- }
-
- posts = await _timelineService.GetPosts(timelineName);
- posts.Should().HaveCount(2);
- posts.Select(p => p.Deleted).Should().Equal(Enumerable.Repeat(false, posts.Count));
- posts.Select(p => ((TextTimelinePostContent)p.Content!).Text).Should().Equal(new string[] { "b", "d" });
-
- posts = await _timelineService.GetPosts(timelineName, includeDeleted: true);
- posts.Should().HaveCount(4);
- posts.Select(p => p.Deleted).Should().Equal(new bool[] { true, false, true, false });
- posts.Where(p => !p.Deleted).Select(p => ((TextTimelinePostContent)p.Content!).Text).Should().Equal(new string[] { "b", "d" });
- }
-
- [Theory]
- [InlineData("@admin")]
- [InlineData("tl")]
- public async Task GetPosts_ModifiedSince_UsernameChange(string timelineName)
- {
- var time1 = _clock.ForwardCurrentTime();
-
- var userId = await _userService.GetUserIdByUsername("user");
-
- var _ = TimelineHelper.ExtractTimelineName(timelineName, out var isPersonal);
- if (!isPersonal)
- await _timelineService.CreateTimeline(timelineName, userId);
-
- var postContentList = new string[] { "a", "b", "c", "d" };
-
- foreach (var (content, index) in postContentList.Select((v, i) => (v, i)))
- {
- await _timelineService.CreateTextPost(timelineName, userId, content, null);
- }
-
- var time2 = _clock.ForwardCurrentTime();
-
- {
- var posts = await _timelineService.GetPosts(timelineName, time2);
- posts.Should().HaveCount(0);
- }
-
- {
- await _userService.ModifyUser(userId, new ModifyUserParams { Nickname = "haha" });
- var posts = await _timelineService.GetPosts(timelineName, time2);
- posts.Should().HaveCount(0);
- }
-
- {
- await _userService.ModifyUser(userId, new ModifyUserParams { Username = "haha" });
- var posts = await _timelineService.GetPosts(timelineName, time2);
- posts.Should().HaveCount(4);
- }
- }
-
- [Theory]
- [InlineData("@admin")]
- [InlineData("tl")]
- public async Task GetPosts_ModifiedSince_UserDelete(string timelineName)
- {
- var time1 = _clock.ForwardCurrentTime();
-
- var userId = await _userService.GetUserIdByUsername("user");
- var adminId = await _userService.GetUserIdByUsername("admin");
-
- var _ = TimelineHelper.ExtractTimelineName(timelineName, out var isPersonal);
- if (!isPersonal)
- await _timelineService.CreateTimeline(timelineName, adminId);
-
- var postContentList = new string[] { "a", "b", "c", "d" };
-
- foreach (var (content, index) in postContentList.Select((v, i) => (v, i)))
- {
- await _timelineService.CreateTextPost(timelineName, userId, content, null);
- }
-
- var time2 = _clock.ForwardCurrentTime();
-
- {
- var posts = await _timelineService.GetPosts(timelineName, time2);
- posts.Should().HaveCount(0);
- }
-
- await _userDeleteService.DeleteUser("user");
-
- {
- var posts = await _timelineService.GetPosts(timelineName, time2);
- posts.Should().HaveCount(0);
- }
-
- {
- var posts = await _timelineService.GetPosts(timelineName, time2, true);
- posts.Should().HaveCount(4);
- }
- }
-
- [Theory]
[InlineData("@admin")]
[InlineData("tl")]
public async Task Title(string timelineName)
diff --git a/BackEnd/Timeline.Tests/Services/UserDeleteServiceTest.cs b/BackEnd/Timeline.Tests/Services/UserDeleteServiceTest.cs
index be11564e..59c0a9af 100644
--- a/BackEnd/Timeline.Tests/Services/UserDeleteServiceTest.cs
+++ b/BackEnd/Timeline.Tests/Services/UserDeleteServiceTest.cs
@@ -10,12 +10,12 @@ namespace Timeline.Tests.Services
{
public class UserDeleteServiceTest : DatabaseBasedTest
{
- private readonly Mock<ITimelineService> _mockTimelineService = new Mock<ITimelineService>();
+ private readonly Mock<ITimelinePostService> _mockTimelinePostService = new Mock<ITimelinePostService>();
private UserDeleteService _service = default!;
protected override void OnDatabaseCreated()
{
- _service = new UserDeleteService(NullLogger<UserDeleteService>.Instance, Database, _mockTimelineService.Object);
+ _service = new UserDeleteService(NullLogger<UserDeleteService>.Instance, Database, _mockTimelinePostService.Object);
}
[Fact]
diff --git a/BackEnd/Timeline.Tests/packages.lock.json b/BackEnd/Timeline.Tests/packages.lock.json
index 7d84213e..50b90c3c 100644
--- a/BackEnd/Timeline.Tests/packages.lock.json
+++ b/BackEnd/Timeline.Tests/packages.lock.json
@@ -763,8 +763,8 @@
},
"NJsonSchema": {
"type": "Transitive",
- "resolved": "10.2.1",
- "contentHash": "/BtWbYTusyoSgQkCB4eYijMfZotB/rfASDsl1k9evlkm5vlOP4s4Y09TOzBChU77d/qUABVYL1Xf+TB8E0Wfpw==",
+ "resolved": "10.3.1",
+ "contentHash": "k5ptrRSxMy1lZXxU7dXW2Gy9Q7uPufSGtb609tfuFdo+w45UMHdBolvbWeEq482BPXhYfoBZ2uNzjJgcny2o3g==",
"dependencies": {
"Namotion.Reflection": "1.0.14",
"Newtonsoft.Json": "9.0.1"
@@ -772,56 +772,56 @@
},
"NSwag.Annotations": {
"type": "Transitive",
- "resolved": "13.8.2",
- "contentHash": "/GO+35CjPYQTPS5/Q8udM5JAMEWVo8JsrkV2Uw3OW4/AJU9iOS7t6WJid6ZlkpLMjnW7oex9mvJ2EZNE4eOG/Q=="
+ "resolved": "13.9.4",
+ "contentHash": "qsOYnNMUJJ5VpgYmQsyNkDKbJnMaRo4lGBgkaBlZsHsWGG+HizNkx+HuHkRtI0ks28jqZXpVDxDmnuyq/SwFnw=="
},
"NSwag.AspNetCore": {
"type": "Transitive",
- "resolved": "13.8.2",
- "contentHash": "SNGlVSZoMyywBWueZBxl3B/nfaIM0fAcuNhTD/cfMKUn3Cn/Oi8d45HZY5vAPqczvppTbk4cZXyVwWDOfgiPbA==",
+ "resolved": "13.9.4",
+ "contentHash": "2+QqWsUMfwOy1pFsacA4hjVW0tmKrcGG4O1JCVhM93q7QfqbG/ndt002a/GGGyaMsuK7HRKmYJ8nmo5tzOE1tg==",
"dependencies": {
"Microsoft.AspNetCore.Mvc.Core": "1.0.4",
"Microsoft.AspNetCore.Mvc.Formatters.Json": "1.0.4",
"Microsoft.AspNetCore.StaticFiles": "1.0.4",
"Microsoft.Extensions.ApiDescription.Server": "3.0.0",
"Microsoft.Extensions.FileProviders.Embedded": "1.0.1",
- "NSwag.Annotations": "13.8.2",
- "NSwag.Core": "13.8.2",
- "NSwag.Generation": "13.8.2",
- "NSwag.Generation.AspNetCore": "13.8.2",
+ "NSwag.Annotations": "13.9.4",
+ "NSwag.Core": "13.9.4",
+ "NSwag.Generation": "13.9.4",
+ "NSwag.Generation.AspNetCore": "13.9.4",
"System.IO.FileSystem": "4.3.0",
"System.Xml.XPath.XDocument": "4.0.1"
}
},
"NSwag.Core": {
"type": "Transitive",
- "resolved": "13.8.2",
- "contentHash": "Hm6pU9qFJuXLo3b27+JTXztfeuI/15Ob1sDsfUu4rchN0+bMogtn8Lia8KVbcalw/M+hXc0rWTFp5ueP23e+iA==",
+ "resolved": "13.9.4",
+ "contentHash": "iNhgBGWT5yEYL3uV6Xhla+VspVaN3NfDi+rjDugWLErU+A7uxV71D1i9OQkW37rdOFKiaixJAXPaLA6JA8c8hw==",
"dependencies": {
- "NJsonSchema": "10.2.1",
+ "NJsonSchema": "10.3.1",
"Newtonsoft.Json": "9.0.1"
}
},
"NSwag.Generation": {
"type": "Transitive",
- "resolved": "13.8.2",
- "contentHash": "LBIrpHFRZeMMbqL1hdyGb7r8v+T52aOCARxwfAmzE+MlOHVpjsIxyNSXht9EzBFMbSH0tj7CK2Ugo7bm+zUssg==",
+ "resolved": "13.9.4",
+ "contentHash": "Y6qqOYUEoYZRL5nYshzYn0b7Nz9Rzr6qCdVkah6mQq39Pom/XQgygaV6JR3t0dacDYg/XmVsMn++bdLPQs9rAw==",
"dependencies": {
- "NJsonSchema": "10.2.1",
- "NSwag.Core": "13.8.2",
+ "NJsonSchema": "10.3.1",
+ "NSwag.Core": "13.9.4",
"Newtonsoft.Json": "9.0.1"
}
},
"NSwag.Generation.AspNetCore": {
"type": "Transitive",
- "resolved": "13.8.2",
- "contentHash": "0ydVv6OidspZ/MS6qmU8hswGtXwq5YZPg+2a2PHGD6jNp2Fef4j1wC3xa3hplDAq7cK+BgpyDKtvj9+X01+P5g==",
+ "resolved": "13.9.4",
+ "contentHash": "N0HGoPJsK67GAtNnPln0MLPnmv9wVp9Ev5sfEuWQIa/VHMkXQL6IyvItXiigDLb8VHXnqUbggU7WBg9Ay6h8oQ==",
"dependencies": {
"Microsoft.AspNetCore.Mvc.ApiExplorer": "1.0.4",
"Microsoft.AspNetCore.Mvc.Core": "1.0.4",
"Microsoft.AspNetCore.Mvc.Formatters.Json": "1.0.4",
- "NJsonSchema": "10.2.1",
- "NSwag.Generation": "13.8.2"
+ "NJsonSchema": "10.3.1",
+ "NSwag.Generation": "13.9.4"
}
},
"NuGet.Frameworks": {
@@ -938,8 +938,8 @@
},
"SixLabors.ImageSharp": {
"type": "Transitive",
- "resolved": "1.0.1",
- "contentHash": "DjLoFNdUfsDP7RhPpr5hcUhl1XiejqBML9uDWuOUwCkc0Y+sG9IJLLbqSOi9XeoWqPviwdcDm1F8nKdF0qTYIQ=="
+ "resolved": "1.0.2",
+ "contentHash": "iZJ37Iss3pUkFl961x1aka85QuvgY9oNZabHijzVnHs4QTz6EMNx3zjJDyvK/0+Ryj6JPv/PC7GVIJXLHtu2nQ=="
},
"SQLitePCLRaw.bundle_e_sqlite3": {
"type": "Transitive",
@@ -1985,8 +1985,8 @@
"Microsoft.EntityFrameworkCore": "5.0.0",
"Microsoft.EntityFrameworkCore.Analyzers": "5.0.0",
"Microsoft.EntityFrameworkCore.Sqlite": "5.0.0",
- "NSwag.AspNetCore": "13.8.2",
- "SixLabors.ImageSharp": "1.0.1",
+ "NSwag.AspNetCore": "13.9.4",
+ "SixLabors.ImageSharp": "1.0.2",
"System.IdentityModel.Tokens.Jwt": "6.8.0",
"Timeline.ErrorCodes": "1.0.0"
}