Explorar el Código

AppendixText command

Andrew Grant hace 2 meses
padre
commit
1a1a3be67e

+ 28 - 0
src/main/java/scot/carricksoftware/grants/commands/text/AppendixTextCommand.java

@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) Andrew Grant of Carrick Software 30/03/2025, 10:42. All rights reserved.
+ *
+ */
+
+package scot.carricksoftware.grants.commands.text;
+
+public interface AppendixTextCommand {
+    Long getId();
+
+    void setId(Long id);
+
+    Long getLevel();
+
+    void setLevel(Long level);
+
+    Long getOrder();
+
+    void setOrder(Long order);
+
+    String getHeading();
+
+    void setHeading(String heading);
+
+    String getContent();
+
+    void setContent(String content);
+}

+ 69 - 0
src/main/java/scot/carricksoftware/grants/commands/text/AppendixTextCommandImpl.java

@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) Andrew Grant of Carrick Software 30/03/2025, 10:42. All rights reserved.
+ *
+ */
+
+package scot.carricksoftware.grants.commands.text;
+
+public class AppendixTextCommandImpl implements AppendixTextCommand {
+
+    Long Id;
+    private Long level;
+    private Long order;
+    private String heading;
+    private String content;
+
+    @Override
+    public Long getId() {
+        return Id;
+    }
+
+    @Override
+    public void setId(Long id) {
+        Id = id;
+    }
+
+
+    @Override
+    public Long getLevel() {
+        return level;
+    }
+
+    @Override
+    public void setLevel(Long level) {
+        this.level = level;
+    }
+
+    @Override
+    public Long getOrder() {
+        return order;
+    }
+
+    @Override
+    public void setOrder(Long order) {
+        this.order = order;
+    }
+
+    @Override
+    public String getHeading() {
+        return heading;
+    }
+
+    @Override
+    public void setHeading(String heading) {
+        this.heading = heading;
+    }
+
+    @Override
+    public String getContent() {
+        return content;
+    }
+
+    @Override
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+
+
+}

+ 86 - 0
src/test/java/scot/carricksoftware/grants/commands/text/AppendixTextCommandTest.java

@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2025.  Andrew Grant Carrick Software. All rights reserved
+ *
+ */
+
+package scot.carricksoftware.grants.commands.text;
+
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static scot.carricksoftware.grants.GenerateCertificateRandomValues.GetRandomString;
+import static scot.carricksoftware.grants.GenerateRandomNumberValues.GetRandomLong;
+
+class AppendixTextCommandTest {
+
+    private AppendixTextCommand appendixTextCommand;
+
+    @BeforeEach
+    void setUp() {
+        appendixTextCommand = new AppendixTextCommandImpl();
+    }
+
+    @Test
+    void getIdTest() {
+        assertNull(appendixTextCommand.getId());
+    }
+
+    @Test
+    void setIdTest() {
+        Long id = GetRandomLong();
+        appendixTextCommand.setId(id);
+        assertEquals(id, appendixTextCommand.getId());
+    }
+
+    @Test
+    void getLevelTest() {
+        assertNull(appendixTextCommand.getLevel());
+    }
+
+    @Test
+    void setLevelTest() {
+        Long level = GetRandomLong();
+        appendixTextCommand.setLevel(level);
+        assertEquals(level, appendixTextCommand.getLevel());
+    }
+
+    @Test
+    void getOrderTest() {
+        assertNull(appendixTextCommand.getOrder());
+    }
+
+    @Test
+    void setOrderTest() {
+        Long order = GetRandomLong();
+        appendixTextCommand.setOrder(order);
+        assertEquals(order, appendixTextCommand.getOrder());
+    }
+
+    @Test
+    void getHeadingTest() {
+        assertNull(appendixTextCommand.getHeading());
+    }
+
+    @Test
+    void setHeadingTest() {
+        String heading = GetRandomString();
+        appendixTextCommand.setHeading(heading);
+        assertEquals(heading, appendixTextCommand.getHeading());
+    }
+
+    @Test
+    void getContentTest() {
+        assertNull(appendixTextCommand.getContent());
+    }
+
+    @Test
+    void setContentTest() {
+        String content = GetRandomString();
+        appendixTextCommand.setContent(content);
+        assertEquals(content, appendixTextCommand.getContent());
+    }
+
+}