-
-
Notifications
You must be signed in to change notification settings - Fork 512
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed failing acceptance tests and event listener registration to not…
… cause issues with double registration
- Loading branch information
1 parent
fdf65bc
commit 4a8c0d8
Showing
8 changed files
with
52 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
Sample/EventStoreDB/Simple/ECommerce.Api.Tests/ShoppingCartsApplicationFactory.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using Core.Testing; | ||
using ECommerce.Storage; | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Microsoft.Extensions.Hosting; | ||
|
||
namespace Warehouse.Api.Tests; | ||
|
||
public class ShoppingCartsApplicationFactory: TestWebApplicationFactory<Program> | ||
{ | ||
protected override IHost CreateHost(IHostBuilder builder) | ||
{ | ||
var host = base.CreateHost(builder); | ||
|
||
using var scope = host.Services.CreateScope(); | ||
using var context = scope.ServiceProvider.GetRequiredService<ECommerceDbContext>(); | ||
var database = context.Database; | ||
database.ExecuteSqlRaw("TRUNCATE TABLE \"ShoppingCartDetailsProductItem\""); | ||
database.ExecuteSqlRaw("TRUNCATE TABLE \"ShoppingCartShortInfo\""); | ||
database.ExecuteSqlRaw("TRUNCATE TABLE \"ShoppingCartDetails\" CASCADE"); | ||
|
||
return host; | ||
} | ||
} |