From eae10c9da7217eb00758635fae856fb64446370b Mon Sep 17 00:00:00 2001 From: Glenn Clarke Date: Wed, 27 Nov 2024 17:34:58 +0000 Subject: [PATCH] PC-577: Update tests --- .../BusinessLogic/Models/PropertyDataTests.cs | 1 + .../Models/ResetUnusedFieldsTests.cs | 6 +- .../Services/QuestionFlowServiceTests.cs | 65 ++++++++++++++----- 3 files changed, 54 insertions(+), 18 deletions(-) diff --git a/SeaPublicWebsite.UnitTests/BusinessLogic/Models/PropertyDataTests.cs b/SeaPublicWebsite.UnitTests/BusinessLogic/Models/PropertyDataTests.cs index c23dbb2d..2b05241e 100644 --- a/SeaPublicWebsite.UnitTests/BusinessLogic/Models/PropertyDataTests.cs +++ b/SeaPublicWebsite.UnitTests/BusinessLogic/Models/PropertyDataTests.cs @@ -45,6 +45,7 @@ private PropertyData InitializePropertyData() Temperature = 20, UneditedData = new PropertyData(), HasSeenRecommendations = false, + SolarElectricPanels = SolarElectricPanels.Yes, RecommendationsFirstRetrievedAt = DateTime.Now.ToUniversalTime(), PropertyRecommendations = new List { diff --git a/SeaPublicWebsite.UnitTests/BusinessLogic/Models/ResetUnusedFieldsTests.cs b/SeaPublicWebsite.UnitTests/BusinessLogic/Models/ResetUnusedFieldsTests.cs index f1f89dab..59f06124 100644 --- a/SeaPublicWebsite.UnitTests/BusinessLogic/Models/ResetUnusedFieldsTests.cs +++ b/SeaPublicWebsite.UnitTests/BusinessLogic/Models/ResetUnusedFieldsTests.cs @@ -119,7 +119,8 @@ public void RunResetUnusedFieldTestCases(ResetUnusedFieldsTestCase testCase) FlatType = FlatType.GroundFloor, RoofConstruction = RoofConstruction.Mixed, LoftSpace = LoftSpace.Yes, - RoofInsulated = RoofInsulated.Yes + RoofInsulated = RoofInsulated.Yes, + SolarElectricPanels = SolarElectricPanels.Yes }, new() { @@ -137,7 +138,8 @@ public void RunResetUnusedFieldTestCases(ResetUnusedFieldsTestCase testCase) FloorInsulated = FloorInsulated.Yes, RoofConstruction = RoofConstruction.Mixed, LoftSpace = LoftSpace.Yes, - RoofInsulated = RoofInsulated.Yes + RoofInsulated = RoofInsulated.Yes, + SolarElectricPanels = SolarElectricPanels.Yes }, new() { diff --git a/SeaPublicWebsite.UnitTests/BusinessLogic/Services/QuestionFlowServiceTests.cs b/SeaPublicWebsite.UnitTests/BusinessLogic/Services/QuestionFlowServiceTests.cs index b012d983..185d31dc 100644 --- a/SeaPublicWebsite.UnitTests/BusinessLogic/Services/QuestionFlowServiceTests.cs +++ b/SeaPublicWebsite.UnitTests/BusinessLogic/Services/QuestionFlowServiceTests.cs @@ -402,12 +402,30 @@ public void RunSkipLinkTestCases(QuestionFlowServiceTestCase testCase) ), QuestionFlowStep.AnswerSummary), new( - "Loft space goes back to roof construction", + "Solar (PV) panels goes back to roof construction", + new Input( + QuestionFlowStep.SolarElectricPanels, + propertyType: PropertyType.ApartmentFlatOrMaisonette, + flatType: FlatType.TopFloor, + wallConstruction: WallConstruction.DoNotKnow, + reference: "ABCDEFGH" + ), + QuestionFlowStep.RoofConstruction), + new( + "Changing solar (PV) panels goes back to summary", + new Input( + QuestionFlowStep.SolarElectricPanels, + "ABCDEFGH", + entryPoint: QuestionFlowStep.SolarElectricPanels + ), + QuestionFlowStep.AnswerSummary), + new( + "Loft space goes back to solar (PV) panels", new Input( QuestionFlowStep.LoftSpace, "ABCDEFGH" ), - QuestionFlowStep.RoofConstruction), + QuestionFlowStep.SolarElectricPanels), new( "Changing loft space goes back to summary", new Input( @@ -447,14 +465,14 @@ public void RunSkipLinkTestCases(QuestionFlowServiceTestCase testCase) ), QuestionFlowStep.AnswerSummary), new( - "Glazing type goes back to roof construction if the user has flat roof", + "Glazing type goes back to solar (PV) panels if the user has flat roof", new Input( QuestionFlowStep.GlazingType, "ABCDEFGH", propertyType: PropertyType.House, roofConstruction: RoofConstruction.Flat ), - QuestionFlowStep.RoofConstruction), + QuestionFlowStep.SolarElectricPanels), new( "Glazing type goes back to loft space if the user does not have flat roof nor loft space", new Input( @@ -1060,38 +1078,53 @@ public void RunSkipLinkTestCases(QuestionFlowServiceTestCase testCase) ), QuestionFlowStep.GlazingType), new( - "Roof construction continues to loft space if roof is pitched", + "Roof construction continues to solar (PV) panels", + new Input( + QuestionFlowStep.RoofConstruction, + "ABCDEFGH" + ), + QuestionFlowStep.SolarElectricPanels), + new( + "Changing roof construction continues to summary if roof is not pitched", new Input( QuestionFlowStep.RoofConstruction, "ABCDEFGH", + roofConstruction: RoofConstruction.Flat, + entryPoint: QuestionFlowStep.RoofConstruction + ), + QuestionFlowStep.AnswerSummary), + new( + "Solar (PV) panels continues to loft space if roof is pitched", + new Input( + QuestionFlowStep.SolarElectricPanels, + "ABCDEFGH", roofConstruction: RoofConstruction.Pitched ), QuestionFlowStep.LoftSpace), new( - "Roof construction continues to loft space if roof is mixed", + "Solar (PV) panels continues to loft space if roof is mixed", new Input( - QuestionFlowStep.RoofConstruction, + QuestionFlowStep.SolarElectricPanels, "ABCDEFGH", roofConstruction: RoofConstruction.Mixed ), QuestionFlowStep.LoftSpace), new( - "Changing roof construction continues to summary if roof is not pitched", + "Solar (PV) panels continues to glazing type space if roof is not pitched", new Input( - QuestionFlowStep.RoofConstruction, + QuestionFlowStep.SolarElectricPanels, "ABCDEFGH", - roofConstruction: RoofConstruction.Flat, - entryPoint: QuestionFlowStep.RoofConstruction + roofConstruction: RoofConstruction.Flat ), - QuestionFlowStep.AnswerSummary), + QuestionFlowStep.GlazingType), new( - "Roof construction continues to glazing type space if roof is not pitched", + "Changing solar (PV) panels continues to summary", new Input( - QuestionFlowStep.RoofConstruction, + QuestionFlowStep.SolarElectricPanels, "ABCDEFGH", - roofConstruction: RoofConstruction.Flat + entryPoint: QuestionFlowStep.SolarElectricPanels ), - QuestionFlowStep.GlazingType), + QuestionFlowStep.AnswerSummary), new( "Loft space continues to loft access if user has it", new Input(