Skip to content

Commit

Permalink
Fixed Device Manager Integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DAQEM committed Jan 15, 2024
1 parent fd5bbae commit c9ba0b4
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ public class DiscoverIntegrationTests : IClassFixture<WebApplicationFactory<Devi
public DiscoverIntegrationTests(WebApplicationFactory<DeviceManagerProgram> factory)
{
_factory = factory;
const string userName = "testuser";
const string fullName = "Test User";
const string profileImageName = "testuser.jpg";
const string email = "test@test.com";
const string password = "P@ssw0rd!";

Expand All @@ -25,9 +28,9 @@ public DiscoverIntegrationTests(WebApplicationFactory<DeviceManagerProgram> fact
try
{
HttpResponseMessage registerResponse =
client.PostAsJsonAsync("http://localhost:5001/register", new { email, password }).Result;
client.PostAsJsonAsync("http://localhost:5001/myregister", new { userName, fullName, profileImageName, email, password }).Result;
HttpResponseMessage loginResponse =
client.PostAsJsonAsync("http://localhost:5001/login", new { email, password }).Result;
client.PostAsJsonAsync("http://localhost:5001/login", new { email = userName, password }).Result;
loginResponse.EnsureSuccessStatusCode();
JsonElement jsonElement = loginResponse.Content.ReadFromJsonAsync<JsonElement>().Result;
_token = jsonElement.GetProperty("accessToken").GetString() ?? string.Empty;
Expand Down

0 comments on commit c9ba0b4

Please sign in to comment.