From c9814a214211ccb9af0019af221473903840b68e Mon Sep 17 00:00:00 2001 From: Stedoss <29103029+Stedoss@users.noreply.github.com> Date: Sun, 30 Oct 2022 17:48:47 +0000 Subject: [PATCH] Change return type of `VenueTestData` to be array --- .../LeedsBeerQuest.API.Tests/Data/Services/TestData.cs | 2 +- .../Data/Services/VenueServiceTests.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/LeedsBeerQuest.API/LeedsBeerQuest.API.Tests/Data/Services/TestData.cs b/backend/LeedsBeerQuest.API/LeedsBeerQuest.API.Tests/Data/Services/TestData.cs index b45086b..59fbbd5 100644 --- a/backend/LeedsBeerQuest.API/LeedsBeerQuest.API.Tests/Data/Services/TestData.cs +++ b/backend/LeedsBeerQuest.API/LeedsBeerQuest.API.Tests/Data/Services/TestData.cs @@ -6,7 +6,7 @@ namespace LeedsBeerQuest.API.Tests.Data.Services; public static class TestData { - public static IEnumerable VenueTestData => new[] + public static Venue[] VenueTestData => new[] { new Venue { diff --git a/backend/LeedsBeerQuest.API/LeedsBeerQuest.API.Tests/Data/Services/VenueServiceTests.cs b/backend/LeedsBeerQuest.API/LeedsBeerQuest.API.Tests/Data/Services/VenueServiceTests.cs index 569a08d..741f722 100644 --- a/backend/LeedsBeerQuest.API/LeedsBeerQuest.API.Tests/Data/Services/VenueServiceTests.cs +++ b/backend/LeedsBeerQuest.API/LeedsBeerQuest.API.Tests/Data/Services/VenueServiceTests.cs @@ -33,7 +33,7 @@ public class VenueServiceTests var result = await _venueService.GetAllVenues(); 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].Name, resultArray[0].Name); @@ -71,7 +71,7 @@ public class VenueServiceTests private async Task seedVenueTestData() { - var venueTestData = TestData.VenueTestData.ToArray(); + var venueTestData = TestData.VenueTestData; _context.Venues.AddRange(venueTestData); await _context.SaveChangesAsync();