Эх сурвалжийг харах

Rooms added to Census Command

Andrew Grant 7 сар өмнө
parent
commit
1c272ad2fb

+ 8 - 0
src/main/java/scot/carricksoftware/grants/commands/census/CensusCommand.java

@@ -32,4 +32,12 @@ public interface CensusCommand {
     CensusBoundaryType getBoundaryType();
 
     void setBoundaryType(CensusBoundaryType boundaryType);
+
+    String getInhabitedRooms();
+
+    void setInhabitedRooms(String inhabitedRooms);
+
+    String getRoomsWithWindows();
+
+    void setRoomsWithWindows(String roomsWithWindows);
 }

+ 24 - 0
src/main/java/scot/carricksoftware/grants/commands/census/CensusCommandImpl.java

@@ -25,6 +25,10 @@ public class CensusCommandImpl implements CensusCommand {
 
     private CensusBoundaryType boundaryType;
 
+    private String inhabitedRooms;
+
+    private String roomsWithWindows;
+
     @Override
     public Long getId() {
         return id;
@@ -74,4 +78,24 @@ public class CensusCommandImpl implements CensusCommand {
     public void setBoundaryType(CensusBoundaryType boundaryType) {
         this.boundaryType = boundaryType;
     }
+
+    @Override
+    public String getInhabitedRooms() {
+        return inhabitedRooms;
+    }
+
+    @Override
+    public void setInhabitedRooms(String inhabitedRooms) {
+        this.inhabitedRooms = inhabitedRooms;
+    }
+
+    @Override
+    public String getRoomsWithWindows() {
+        return roomsWithWindows;
+    }
+
+    @Override
+    public void setRoomsWithWindows(String roomsWithWindows) {
+        this.roomsWithWindows = roomsWithWindows;
+    }
 }

+ 26 - 2
src/test/java/scot/carricksoftware/grants/commands/census/CensusCommandTest.java

@@ -14,6 +14,7 @@ import java.util.ArrayList;
 import java.util.List;
 
 import static org.junit.jupiter.api.Assertions.*;
+import static scot.carricksoftware.grants.GenerateCertificateRandomValues.GetRandomString;
 import static scot.carricksoftware.grants.GenerateRandomCensusValues.GetRandomCensusEntry;
 import static scot.carricksoftware.grants.GenerateRandomPlaceValues.GetRandomPlace;
 
@@ -27,8 +28,6 @@ class CensusCommandTest {
     }
 
 
-
-
     @Test
     void getCensusEntriesTest() {
         assertTrue(command.getCensusEntries().isEmpty());
@@ -53,4 +52,29 @@ class CensusCommandTest {
         command.setPlace(place);
         assertEquals(place, command.getPlace());
     }
+
+    @Test
+    public void getInhabitedRoomsTest() {
+        assertNull(command.getInhabitedRooms());
+    }
+
+    @Test
+    public void setInhabitedRoomsTest() {
+        String string = GetRandomString();
+        command.setInhabitedRooms(string);
+        assertEquals(string, command.getInhabitedRooms());
+    }
+
+    @Test
+    public void getRoomsWithWidowsTest() {
+        assertNull(command.getRoomsWithWindows());
+    }
+
+    @Test
+    public void setRoomsWithWidowsTest() {
+        String string = GetRandomString();
+        command.setRoomsWithWindows(string);
+        assertEquals(string, command.getRoomsWithWindows());
+    }
+
 }