Change return type of VenueTestData to be array

This commit is contained in:
Stedoss 2022-10-30 17:48:47 +00:00
parent 1ca97bb03c
commit c9814a2142
2 changed files with 3 additions and 3 deletions

View File

@ -6,7 +6,7 @@ namespace LeedsBeerQuest.API.Tests.Data.Services;
public static class TestData public static class TestData
{ {
public static IEnumerable<Venue> VenueTestData => new[] public static Venue[] VenueTestData => new[]
{ {
new Venue new Venue
{ {

View File

@ -33,7 +33,7 @@ public class VenueServiceTests
var result = await _venueService.GetAllVenues(); var result = await _venueService.GetAllVenues();
var resultArray = result.ToArray(); var resultArray = result.ToArray();
Assert.AreEqual(1, resultArray.Length); Assert.AreEqual(venueTestData.Length, resultArray.Length);
Assert.AreEqual(venueTestData[0].Id, resultArray[0].Id); Assert.AreEqual(venueTestData[0].Id, resultArray[0].Id);
Assert.AreEqual(venueTestData[0].Name, resultArray[0].Name); Assert.AreEqual(venueTestData[0].Name, resultArray[0].Name);
@ -71,7 +71,7 @@ public class VenueServiceTests
private async Task<Venue[]> seedVenueTestData() private async Task<Venue[]> seedVenueTestData()
{ {
var venueTestData = TestData.VenueTestData.ToArray(); var venueTestData = TestData.VenueTestData;
_context.Venues.AddRange(venueTestData); _context.Venues.AddRange(venueTestData);
await _context.SaveChangesAsync(); await _context.SaveChangesAsync();