Skip to content

Commit

Permalink
fix: test case
Browse files Browse the repository at this point in the history
  • Loading branch information
hermanho committed Sep 14, 2023
1 parent 181265d commit 22f80a9
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: dotnet-results-${{ matrix.dotnet-version }}
path: TestResults-${{ matrix.dotnet-version }}
path: **/TestResults/TestResults-${{ matrix.dotnet-version }}.trx
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: dotnet-results-${{ matrix.dotnet-version }}
path: TestResults-${{ matrix.dotnet-version }}
path: **/TestResults/TestResults-${{ matrix.dotnet-version }}.trx
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}

Expand Down
12 changes: 12 additions & 0 deletions test/Postal.Tests.Integration/CustomWebApplicationFactory.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using Microsoft.AspNetCore.Mvc.Testing;

namespace Postal.Tests.Integration;

public class CustomWebApplicationFactory<TProgram>
: WebApplicationFactory<TProgram> where TProgram : class
{
protected override void ConfigureWebHost(IWebHostBuilder builder)
{
builder.UseContentRoot(AppContext.BaseDirectory);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
namespace Postal.Tests.Integration.IntegrationTests;

public class EmailViewTests :
IClassFixture<WebApplicationFactory<Program>>
IClassFixture<CustomWebApplicationFactory<Program>>
{
private readonly HttpClient _client;
private readonly WebApplicationFactory<Program>
private readonly CustomWebApplicationFactory<Program>
_factory;

public EmailViewTests(
WebApplicationFactory<Program> factory)
CustomWebApplicationFactory<Program> factory)
{
_factory = factory;
var server = factory.Services.GetRequiredService<IServer>();
Expand Down

0 comments on commit 22f80a9

Please sign in to comment.