Skip to content

Commit

Permalink
491: Update borken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
evan-scales committed Apr 14, 2024
1 parent ff35d87 commit 46c75e5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions FU.API/FU.API.Tests/AccountServiceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void Dispose()
public async void CreateUser_WithValidCredentials_ReturnsUser()
{
// Arange
Credentials credentials = new() { Username = "Test", Password = "Test" };
Credentials credentials = new() { Username = "Test", Password = "Test12345" };

// Act
ApplicationUser user = await _accountsService.Register(credentials);
Expand All @@ -62,7 +62,7 @@ public async void CreateUser_WithValidCredentials_ReturnsUser()
public async void ChangeUsername_WithValidUsername_ChangesUsername()
{
// Arange
Credentials credentials = new() { Username = "Username1", Password = "Test" };
Credentials credentials = new() { Username = "Username1", Password = "Test12345" };
string newUsername = "Username2";
ApplicationUser user = await _accountsService.Register(credentials);

Expand Down
6 changes: 3 additions & 3 deletions FU.API/FU.API.Tests/PostServiceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public async void GetPostUsers_WithMultipleUsers_ReturnsCorrectUserCount()
// Arrange
// Note: CreateTestPostAsync creates one user as part of creating a post
Post post = await TestsHelper.CreateTestPostAsync(_dbContext);
var user2 = await TestsHelper.CreateUserAsync(_dbContext, new Credentials() { Username = "user2", Password = "pass2", Email = "[email protected]" });
var user2 = await TestsHelper.CreateUserAsync(_dbContext, new Credentials() { Username = "user2", Password = "Test12345", Email = "[email protected]" });
await _postService.JoinPost(post.Id, user2);

// Act
Expand Down Expand Up @@ -166,7 +166,7 @@ public async void JoinPost_WhenAlreadyMember_ThrowsConflictException()
{
// Arrange
Post post = await TestsHelper.CreateTestPostAsync(_dbContext);
var user2 = await TestsHelper.CreateUserAsync(_dbContext, new Credentials() { Username = "user2", Password = "pass2", Email = "[email protected]" });
var user2 = await TestsHelper.CreateUserAsync(_dbContext, new Credentials() { Username = "user2", Password = "Test12345", Email = "[email protected]" });
await _postService.JoinPost(post.Id, user2);

// Act & Assert
Expand All @@ -180,7 +180,7 @@ public async void LeavePost_WhenMember_LeavesPost()
{
// Arrange
Post post = await TestsHelper.CreateTestPostAsync(_dbContext);
var user2 = await TestsHelper.CreateUserAsync(_dbContext, new Credentials() { Username = "user2", Password = "pass2", Email = "[email protected]" });
var user2 = await TestsHelper.CreateUserAsync(_dbContext, new Credentials() { Username = "user2", Password = "Test12345", Email = "[email protected]" });
await _postService.JoinPost(post.Id, user2);

// Act
Expand Down
6 changes: 3 additions & 3 deletions FU.API/FU.API.Tests/SearchServiceSearchUsersTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,19 @@ public async Task Search_WithKeyword_SearchesTitleAndBio()
{
Username = "User1",
Email = "[email protected]",
Password = "Pass1"
Password = "Test12345"
});
var user2 = await TestsHelper.CreateUserAsync(_dbContext, new Credentials()
{
Username = "User2",
Email = "[email protected]",
Password = "Pass2"
Password = "Test12345"
});
var user3 = await TestsHelper.CreateUserAsync(_dbContext, new Credentials()
{
Username = "User3",
Email = "[email protected]",
Password = "Pass3"
Password = "Test12345"
});
await _userService.UpdateUserProfile(new UserProfile() { Bio = "Bio3", Id = user3.UserId });

Expand Down
2 changes: 1 addition & 1 deletion FU.API/FU.API.Tests/TestsHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public static async Task<Game> CreateTestGameAsync(AppDbContext dbContext)

public static async Task<ApplicationUser> CreateUserAsync(AppDbContext context)
{
Credentials credentials = new() { Username = "Test", Password = "Test", Email = "[email protected]" };
Credentials credentials = new() { Username = "Test", Password = "Test12345", Email = "[email protected]" };
return await CreateUserAsync(context, credentials);
}

Expand Down

0 comments on commit 46c75e5

Please sign in to comment.