mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-10-15 10:04:44 +00:00
Replace stored-procedure repositories with Dapper-based repositories
Removes the USP_* stored procedures for Auth, Location, and Brewery data access in favour of services built with Dapper. Adds a new Features.Locations slice and optimistic concurrency support for the Brewery slice.
This commit is contained in:
@@ -21,6 +21,7 @@ public class UpdateBreweryHandlerTests
|
||||
{
|
||||
UpdateBreweryCommand command = new(
|
||||
Guid.NewGuid(),
|
||||
[0x01, 0x02],
|
||||
Guid.NewGuid(),
|
||||
"Renamed",
|
||||
"New description",
|
||||
@@ -31,7 +32,7 @@ public class UpdateBreweryHandlerTests
|
||||
_repoMock
|
||||
.Setup(r => r.UpdateAsync(It.IsAny<BreweryPost>()))
|
||||
.Callback<BreweryPost>(b => persisted = b)
|
||||
.Returns(Task.CompletedTask);
|
||||
.ReturnsAsync(() => persisted!);
|
||||
|
||||
DateTime before = DateTime.UtcNow;
|
||||
await _handler.Handle(command, CancellationToken.None);
|
||||
@@ -42,6 +43,7 @@ public class UpdateBreweryHandlerTests
|
||||
persisted.PostedById.Should().Be(command.PostedById);
|
||||
persisted.BreweryName.Should().Be("Renamed");
|
||||
persisted.Description.Should().Be("New description");
|
||||
persisted.Timer.Should().Equal(command.Timer);
|
||||
persisted.UpdatedAt.Should().NotBeNull();
|
||||
persisted.UpdatedAt!.Value.Should().BeOnOrAfter(before).And.BeOnOrBefore(after);
|
||||
}
|
||||
@@ -51,6 +53,7 @@ public class UpdateBreweryHandlerTests
|
||||
{
|
||||
UpdateBreweryCommand command = new(
|
||||
Guid.NewGuid(),
|
||||
[0x01, 0x02],
|
||||
Guid.NewGuid(),
|
||||
"Name",
|
||||
"Description",
|
||||
@@ -61,7 +64,7 @@ public class UpdateBreweryHandlerTests
|
||||
_repoMock
|
||||
.Setup(r => r.UpdateAsync(It.IsAny<BreweryPost>()))
|
||||
.Callback<BreweryPost>(b => persisted = b)
|
||||
.Returns(Task.CompletedTask);
|
||||
.ReturnsAsync(() => persisted!);
|
||||
|
||||
await _handler.Handle(command, CancellationToken.None);
|
||||
|
||||
@@ -81,6 +84,7 @@ public class UpdateBreweryHandlerTests
|
||||
);
|
||||
UpdateBreweryCommand command = new(
|
||||
Guid.NewGuid(),
|
||||
[0x01, 0x02],
|
||||
Guid.NewGuid(),
|
||||
"Name",
|
||||
"Description",
|
||||
@@ -91,7 +95,7 @@ public class UpdateBreweryHandlerTests
|
||||
_repoMock
|
||||
.Setup(r => r.UpdateAsync(It.IsAny<BreweryPost>()))
|
||||
.Callback<BreweryPost>(b => persisted = b)
|
||||
.Returns(Task.CompletedTask);
|
||||
.ReturnsAsync(() => persisted!);
|
||||
|
||||
await _handler.Handle(command, CancellationToken.None);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user