Fix tests

This commit is contained in:
Stedoss 2022-11-01 23:07:26 +00:00
parent 5aecc9d2cb
commit 2a920ae85f
2 changed files with 3 additions and 3 deletions

View File

@ -58,7 +58,7 @@ dotnet ef database update
Data seeding is something I've done in projects before (usually through EF migrations), however it seemed to have issues with test data and testing scenario constants (particularly using an in-memory database). Feel free to checkout the seed data migration commit [here](https://github.com/Stedoss/x-lab-lbq/commit/add80a3521495445f9e5abb9cfe399c80d28e6c7) to see what the seeded migration looks like.
The database should seed automatically when launched for the first time, if compiled with the `LBQ_SEED_DATA` constant. It will read the `leedsbeerquest.csv` from the `LeedsBeerQuest.API` directory. It will only seed the database with the CSV data if there is no existing data in the database.
The database should seed automatically when launched for the first time, if compiled with the `LBQ_SEED_DATA` constant. It will read the `leedsbeerquest.csv` from the `LeedsBeerQuest.API` directory. It will only seed the database with the CSV data if there is no existing data in the database. The CSV location can be configured in `appsettings.json` at `Database:Seed:SeedDataLocation`.
#### Running

View File

@ -29,9 +29,9 @@ public class VenueControllerTests
[Test]
public async Task GetAll_ReturnsOk_WithAllVenues_WhenNoVenueIdIsPassed()
{
_venueService.GetAllVenues().Returns(TestData.VenueTestData);
_venueService.GetFilteredVenues().Returns(TestData.VenueTestData);
var result = await _venueController.GetAll();
var result = await _venueController.GetVenues();
var resultValue = ControllerTestHelper.ActionResultToOkResultValue<IEnumerable<Venue>>(result);
Assert.NotNull(resultValue);