mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-10-15 10:04:44 +00:00
Fix Api.Specs test failures: stale Timer column refs and missing test.user fixture
This commit is contained in:
@@ -45,7 +45,7 @@ public class AuthRepositoryTests
|
||||
("CreatedAt", typeof(DateTime)),
|
||||
("UpdatedAt", typeof(DateTime?)),
|
||||
("DateOfBirth", typeof(DateTime)),
|
||||
("Timer", typeof(byte[]))
|
||||
("RowVersion", typeof(byte[]))
|
||||
)
|
||||
.AddRow(
|
||||
expectedUserId,
|
||||
@@ -99,7 +99,7 @@ public class AuthRepositoryTests
|
||||
("CreatedAt", typeof(DateTime)),
|
||||
("UpdatedAt", typeof(DateTime?)),
|
||||
("DateOfBirth", typeof(DateTime)),
|
||||
("Timer", typeof(byte[]))
|
||||
("RowVersion", typeof(byte[]))
|
||||
)
|
||||
.AddRow(
|
||||
userId,
|
||||
@@ -157,7 +157,7 @@ public class AuthRepositoryTests
|
||||
("CreatedAt", typeof(DateTime)),
|
||||
("UpdatedAt", typeof(DateTime?)),
|
||||
("DateOfBirth", typeof(DateTime)),
|
||||
("Timer", typeof(byte[]))
|
||||
("RowVersion", typeof(byte[]))
|
||||
)
|
||||
.AddRow(
|
||||
userId,
|
||||
@@ -210,7 +210,7 @@ public class AuthRepositoryTests
|
||||
("UserAccountId", typeof(Guid)),
|
||||
("Hash", typeof(string)),
|
||||
("CreatedAt", typeof(DateTime)),
|
||||
("Timer", typeof(byte[]))
|
||||
("RowVersion", typeof(byte[]))
|
||||
)
|
||||
.AddRow(credentialId, userId, "hashed_password_value", DateTime.UtcNow, null)
|
||||
);
|
||||
|
||||
@@ -17,7 +17,7 @@ public class AuthRepository(ISqlConnectionFactory connectionFactory)
|
||||
IAuthRepository
|
||||
{
|
||||
private const string SelectColumns =
|
||||
"UserAccountID, Username, FirstName, LastName, Email, CreatedAt, UpdatedAt, DateOfBirth, Timer";
|
||||
"UserAccountID, Username, FirstName, LastName, Email, CreatedAt, UpdatedAt, DateOfBirth, RowVersion";
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <remarks>The account and credential are inserted within a single database transaction.</remarks>
|
||||
@@ -92,7 +92,7 @@ public class AuthRepository(ISqlConnectionFactory connectionFactory)
|
||||
await using DbConnection connection = await CreateConnection();
|
||||
return await connection.QueryFirstOrDefaultAsync<UserCredential>(
|
||||
"""
|
||||
SELECT UserCredentialId, UserAccountId, Hash, CreatedAt, Timer
|
||||
SELECT UserCredentialId, UserAccountId, Hash, CreatedAt, RowVersion
|
||||
FROM dbo.UserCredential
|
||||
WHERE UserAccountId = @UserAccountId AND IsRevoked = 0
|
||||
""",
|
||||
|
||||
@@ -29,7 +29,7 @@ public class UserAccountRepositoryTests
|
||||
("CreatedAt", typeof(DateTime)),
|
||||
("UpdatedAt", typeof(DateTime?)),
|
||||
("DateOfBirth", typeof(DateTime)),
|
||||
("Timer", typeof(byte[]))
|
||||
("RowVersion", typeof(byte[]))
|
||||
)
|
||||
.AddRow(
|
||||
Guid.Parse("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"),
|
||||
@@ -70,7 +70,7 @@ public class UserAccountRepositoryTests
|
||||
("CreatedAt", typeof(DateTime)),
|
||||
("UpdatedAt", typeof(DateTime?)),
|
||||
("DateOfBirth", typeof(DateTime)),
|
||||
("Timer", typeof(byte[]))
|
||||
("RowVersion", typeof(byte[]))
|
||||
)
|
||||
.AddRow(
|
||||
Guid.NewGuid(),
|
||||
@@ -118,7 +118,7 @@ public class UserAccountRepositoryTests
|
||||
("CreatedAt", typeof(DateTime)),
|
||||
("UpdatedAt", typeof(DateTime?)),
|
||||
("DateOfBirth", typeof(DateTime)),
|
||||
("Timer", typeof(byte[]))
|
||||
("RowVersion", typeof(byte[]))
|
||||
)
|
||||
.AddRow(
|
||||
Guid.NewGuid(),
|
||||
@@ -155,7 +155,7 @@ public class UserAccountRepositoryTests
|
||||
("CreatedAt", typeof(DateTime)),
|
||||
("UpdatedAt", typeof(DateTime?)),
|
||||
("DateOfBirth", typeof(DateTime)),
|
||||
("Timer", typeof(byte[]))
|
||||
("RowVersion", typeof(byte[]))
|
||||
)
|
||||
.AddRow(
|
||||
Guid.NewGuid(),
|
||||
|
||||
@@ -14,7 +14,7 @@ public class UserAccountRepository(ISqlConnectionFactory connectionFactory)
|
||||
IUserAccountRepository
|
||||
{
|
||||
private const string SelectColumns =
|
||||
"UserAccountID, Username, FirstName, LastName, Email, CreatedAt, UpdatedAt, DateOfBirth, Timer";
|
||||
"UserAccountID, Username, FirstName, LastName, Email, CreatedAt, UpdatedAt, DateOfBirth, RowVersion";
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<UserAccount?> GetByIdAsync(Guid id)
|
||||
|
||||
Reference in New Issue
Block a user