aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline.Tests/IntegratedTests2/TimelineTest.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-04-08 17:39:07 +0800
committercrupest <crupest@outlook.com>2022-04-08 17:39:07 +0800
commit27e1360ffe4b2f5aa7d240e1de88c5459587b489 (patch)
tree29c7ebd95d0eb9896766f72930dbad3fa83db7c9 /BackEnd/Timeline.Tests/IntegratedTests2/TimelineTest.cs
parentcfc3f74d583d1c2eff634459d57a26647d212a5a (diff)
downloadtimeline-27e1360ffe4b2f5aa7d240e1de88c5459587b489.tar.gz
timeline-27e1360ffe4b2f5aa7d240e1de88c5459587b489.tar.bz2
timeline-27e1360ffe4b2f5aa7d240e1de88c5459587b489.zip
...
Diffstat (limited to 'BackEnd/Timeline.Tests/IntegratedTests2/TimelineTest.cs')
-rw-r--r--BackEnd/Timeline.Tests/IntegratedTests2/TimelineTest.cs34
1 files changed, 34 insertions, 0 deletions
diff --git a/BackEnd/Timeline.Tests/IntegratedTests2/TimelineTest.cs b/BackEnd/Timeline.Tests/IntegratedTests2/TimelineTest.cs
new file mode 100644
index 00000000..19ad315e
--- /dev/null
+++ b/BackEnd/Timeline.Tests/IntegratedTests2/TimelineTest.cs
@@ -0,0 +1,34 @@
+using System;
+using System.Net;
+using System.Net.Http;
+using System.Threading.Tasks;
+using FluentAssertions;
+using Timeline.Models.Http;
+using Xunit;
+using Xunit.Abstractions;
+
+namespace Timeline.Tests.IntegratedTests2
+{
+ public class TimelineTest : IntegratedTestBase
+ {
+ public TimelineTest(ITestOutputHelper testOutput) : base(testOutput)
+ {
+ }
+
+ [Fact]
+ public async Task CreateAndGet()
+ {
+ using var client = CreateClientAsUser();
+ var a = await client.TestJsonSendAsync<HttpTimeline>(HttpMethod.Post, "v2/timelines", new HttpTimelineCreateRequest
+ {
+ Name = "hello"
+ }, expectedStatusCode: HttpStatusCode.Created);
+
+ var b = await client.TestJsonSendAsync<HttpTimeline>(HttpMethod.Get, "v2/timelines/user/hello");
+
+ a.Name.Should().Be(b.Name);
+ a.UniqueId.Should().Be(b.UniqueId);
+ }
+ }
+}
+