Skip to content

Commit

Permalink
fix in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
NotZetka committed Oct 2, 2024
1 parent 110b6f3 commit 5d6589c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Tests/IntegrationTests/AccountsControllerTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using API;
using API.Data;
using API.Data.Dtos;
using API.Handlers.Accounts.List;
using API.Utilities;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc.Testing;
using Microsoft.EntityFrameworkCore;
Expand Down Expand Up @@ -107,10 +109,10 @@ public async Task UserShouldRetriveListOfUsers()
Assert.Equal(HttpStatusCode.OK, response.StatusCode);

var stringResponse = await response.Content.ReadAsStringAsync();
var accountsList = JsonConvert.DeserializeObject<GetAccountsListResponse>(stringResponse);
var accountsList = JsonConvert.DeserializeObject<PagedResult<UserDto>>(stringResponse);

Assert.NotNull(accountsList);
Assert.False(accountsList.Users.Select(x=>x.UserName).Contains("TestList"));
Assert.False(accountsList.Items.Select(x=>x.UserName).Contains("TestList"));

Check warning on line 115 in Tests/IntegrationTests/AccountsControllerTests.cs

View workflow job for this annotation

GitHub Actions / build

Do not use Assert.False() to check if a value exists in a collection. Use Assert.DoesNotContain instead. (https://xunit.net/xunit.analyzers/rules/xUnit2017)
}

private async Task InitializeUsers()
Expand Down

0 comments on commit 5d6589c

Please sign in to comment.