Skip to content

Commit 398c547

Browse files
committed
Refreshed the centres list before making a call in the web test
1 parent d7d4b94 commit 398c547

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

DigitalLearningSolutions.Web.Tests/Controllers/SuperAdmin/CentresControllerTests.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ public void Cleanup()
6262
public void EditCentreDetails_updates_centre_and_redirects_with_successful_save()
6363
{
6464
// Given
65+
IEnumerable<(int, string)> centresList = new List<(int, string)> { (374, "##HEE Demo Centre1##") };
66+
A.CallTo(() => centresDataService.GetAllCentres(false)).Returns(centresList);
6567
var model = new EditCentreDetailsSuperAdminViewModel
6668
{
6769
CentreId = 374,
@@ -92,7 +94,7 @@ public void EditCentreDetails_updates_centre_and_redirects_with_successful_save(
9294
}
9395

9496
[Test]
95-
public void EditCentreDetails_VerifiesCentresList_Results_DuplicateCentre_error()
97+
public void EditCentreDetails_results_DuplicateCentre_error()
9698
{
9799
// Given
98100
IEnumerable<(int, string)> centresList = new List<(int, string)> { (374, "##HEE Demo Centre##") };
@@ -111,8 +113,7 @@ public void EditCentreDetails_VerifiesCentresList_Results_DuplicateCentre_error(
111113
};
112114

113115
// When
114-
var result = controller.EditCentreDetails(model);
115-
116+
var result = controller.EditCentreDetails(model);
116117
// Then
117118
result.Should().BeViewResult();
118119
controller.ModelState.IsValid.Should().BeFalse();

0 commit comments

Comments
 (0)