Skip to content

Refactor test setup for DataAccessLayerTest #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/dotnet-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Build
run: dotnet build --no-restore ./src/Application/src/RazorPagesTestSample/RazorPagesTestSample.csproj
- name: Test
run: dotnet test --no-build --verbosity normal ./src/Application/tests/RazorPagesTestSample.Tests/RazorPagesTestSample.Tests.csproj
run: dotnet test --verbosity normal ./src/Application/tests/RazorPagesTestSample.Tests/RazorPagesTestSample.Tests.csproj
- uses: actions/github-script@v6
if: failure()
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,17 @@ public async Task AddMessageAsync_MessageIsAdded()
{
using (var db = new AppDbContext(Utilities.TestDbContextOptions()))
{
// Arrange
// Arrange
var recId = 10;
var expectedMessage = new Message() { Id = recId, Text = "Message" };

// Act
await db.AddMessageAsync(expectedMessage);
var fakeMessage = new Message() { Id = recId, Text = "Invalid!" };

// Assert
var actualMessage = await db.FindAsync<Message>(recId);
Assert.Equal(expectedMessage, actualMessage);
Assert.Equal(fakeMessage, actualMessage);
}
}

Expand Down
Loading