Format ./web/backend/Features/Features.UserManagement.Tests

This commit is contained in:
Aaron Po
2026-06-20 15:09:43 -04:00
parent 1875dcc8bf
commit 9ac039dfeb
6 changed files with 25 additions and 23 deletions

View File

@@ -11,4 +11,4 @@ internal class TestConnectionFactory(DbConnection conn) : ISqlConnectionFactory
{
return _conn;
}
}
}

View File

@@ -98,19 +98,14 @@ public class UserAccountRepositoryTests
UserAccountRepository repo = CreateRepo(conn);
List<UserAccount> results = (await repo.GetAllAsync(null, null)).ToList();
results.Should().HaveCount(2);
results
.Select(r => r.Username)
.Should()
.BeEquivalentTo("a", "b");
results.Select(r => r.Username).Should().BeEquivalentTo("a", "b");
}
[Fact]
public async Task GetByUsername_ReturnsRow()
{
MockDbConnection conn = new();
conn.Mocks.When(cmd =>
cmd.CommandText == "usp_GetUserAccountByUsername"
)
conn.Mocks.When(cmd => cmd.CommandText == "usp_GetUserAccountByUsername")
.ReturnsTable(
MockTable
.WithColumns(
@@ -179,4 +174,4 @@ public class UserAccountRepositoryTests
result.Should().NotBeNull();
result!.Username.Should().Be("byemail");
}
}
}