Change return type of VenueTestData
to be array
This commit is contained in:
parent
1ca97bb03c
commit
c9814a2142
@ -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
|
||||||
{
|
{
|
||||||
|
@ -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();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user