Skip to content

Commit f869ffe

Browse files
author
Roman Eriksen
committed
Tests implemented
1 parent 0e0ed12 commit f869ffe

File tree

2 files changed

+433
-2
lines changed

2 files changed

+433
-2
lines changed

exercise.tests/IntegrationTests/BaseIntegrationTest.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,13 @@ FROM users u
5858
*/
5959
protected const string TeacherEmail = "anna.gruber160@example.com"; // has post id 34,35 and comment id 37
6060
protected const string TeacherPassword = "Neidintulling!l33t";
61+
protected const int TeacherId = 160;
6162
protected const int TeacherPostID = 34;
6263
protected const int TeacherCommentID = 37;
6364

6465
protected const string StudentEmail1 = "jan.larsen9@example.com"; //id 232, has post id 57, 58 and comment id 2
6566
protected const string StudentPassword1 = "SuperHash!4";
67+
protected const int StudentId1 = 9;
6668
protected const int StudentPostID1 = 57;
6769
protected const int StudentCommentID1 = 2;
6870

@@ -127,11 +129,16 @@ protected async Task<HttpResponseMessage> SendAuthenticatedPatchAsync<T>(string
127129
return await SendAuthenticatedRequestAsync(HttpMethod.Patch, endpoint, token, body);
128130
}
129131

130-
protected async Task<HttpResponseMessage> SendAuthenticatedPutAsync<T>(string endpoint, string token, T body)
132+
protected async Task<HttpResponseMessage> SendAuthenticatedPutAsync<T>(string endpoint, string token, T? body)
131133
{
132134
return await SendAuthenticatedRequestAsync(HttpMethod.Put, endpoint, token, body);
133135
}
134136

137+
protected async Task<HttpResponseMessage> SendAuthenticatedPostAsync(string endpoint, string token)
138+
{
139+
return await SendAuthenticatedRequestAsync<object>(HttpMethod.Post, endpoint, token);
140+
}
141+
135142
protected async Task<HttpResponseMessage> SendAuthenticatedDeleteAsync(string endpoint, string token)
136143
{
137144
return await SendAuthenticatedRequestAsync<object>(HttpMethod.Delete, endpoint, token);

0 commit comments

Comments
 (0)