aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline.Tests/IntegratedTests2
diff options
context:
space:
mode:
Diffstat (limited to 'BackEnd/Timeline.Tests/IntegratedTests2')
-rw-r--r--BackEnd/Timeline.Tests/IntegratedTests2/SelfTest.cs41
-rw-r--r--BackEnd/Timeline.Tests/IntegratedTests2/TimelineTest.cs2
-rw-r--r--BackEnd/Timeline.Tests/IntegratedTests2/TimelineTest2.cs2
3 files changed, 43 insertions, 2 deletions
diff --git a/BackEnd/Timeline.Tests/IntegratedTests2/SelfTest.cs b/BackEnd/Timeline.Tests/IntegratedTests2/SelfTest.cs
new file mode 100644
index 00000000..9698551a
--- /dev/null
+++ b/BackEnd/Timeline.Tests/IntegratedTests2/SelfTest.cs
@@ -0,0 +1,41 @@
+using System;
+using System.Net;
+using System.Net.Http;
+using System.Threading.Tasks;
+using Timeline.Models.Http;
+using Xunit;
+using Xunit.Abstractions;
+
+namespace Timeline.Tests.IntegratedTests2
+{
+ public class SelfTest : IntegratedTestBase
+ {
+ public SelfTest(ITestOutputHelper testOutput) : base(testOutput)
+ {
+ }
+
+ [Fact]
+ public async Task ChangePassword()
+ {
+ await DefaultClient.TestJsonSendAsync(HttpMethod.Post, "v2/self/changepassword", new HttpChangePasswordRequest
+ {
+ OldPassword = "abc",
+ NewPassword = "def"
+ }, expectedStatusCode: HttpStatusCode.Unauthorized);
+
+
+ await UserClient.TestJsonSendAsync(HttpMethod.Post, "v2/self/changepassword", new HttpChangePasswordRequest
+ {
+ OldPassword = "abc",
+ NewPassword = "def"
+ }, expectedStatusCode: HttpStatusCode.UnprocessableEntity);
+
+ await UserClient.TestJsonSendAsync(HttpMethod.Post, "v2/self/changepassword", new HttpChangePasswordRequest
+ {
+ OldPassword = "userpw",
+ NewPassword = "def"
+ }, expectedStatusCode: HttpStatusCode.NoContent);
+ }
+ }
+}
+
diff --git a/BackEnd/Timeline.Tests/IntegratedTests2/TimelineTest.cs b/BackEnd/Timeline.Tests/IntegratedTests2/TimelineTest.cs
index 807314f4..84bd5264 100644
--- a/BackEnd/Timeline.Tests/IntegratedTests2/TimelineTest.cs
+++ b/BackEnd/Timeline.Tests/IntegratedTests2/TimelineTest.cs
@@ -25,7 +25,7 @@ namespace Timeline.Tests.IntegratedTests2
var b = await client.TestJsonSendAsync<HttpTimeline>(HttpMethod.Get, "v2/timelines/user/hello");
- a.Name.Should().Be(b.Name);
+ a.NameV2.Should().Be(b.NameV2);
a.UniqueId.Should().Be(b.UniqueId);
}
diff --git a/BackEnd/Timeline.Tests/IntegratedTests2/TimelineTest2.cs b/BackEnd/Timeline.Tests/IntegratedTests2/TimelineTest2.cs
index b5566ba0..a97ee6d6 100644
--- a/BackEnd/Timeline.Tests/IntegratedTests2/TimelineTest2.cs
+++ b/BackEnd/Timeline.Tests/IntegratedTests2/TimelineTest2.cs
@@ -38,7 +38,7 @@ namespace Timeline.Tests.IntegratedTests2
Color = "#FFFFFF"
});
- b.Name.Should().Be("hello2");
+ b.NameV2.Should().Be("hello2");
b.Title.Should().Be("Hello");
b.Description.Should().Be("A Description.");
b.Visibility.Should().Be(TimelineVisibility.Public);