瀏覽代碼

Country tests

Andrew Grant 3 月之前
父節點
當前提交
94e9e521fd
共有 1 個文件被更改,包括 44 次插入0 次删除
  1. 44 0
      src/test/java/scot/carricksoftware/grantswriter/domains/places/country/CountryTest.java

+ 44 - 0
src/test/java/scot/carricksoftware/grantswriter/domains/places/country/CountryTest.java

@@ -0,0 +1,44 @@
+package scot.carricksoftware.grantswriter.domains.places.country;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import scot.carricksoftware.grantswriter.domains.places.Country;
+
+import static org.junit.jupiter.api.Assertions.*;
+import static scot.carricksoftware.grantswriter.GenerateCertificateRandomValues.GetRandomString;
+import static scot.carricksoftware.grantswriter.GenerateRandomNumberValues.GetRandomLong;
+
+class CountryTest {
+    private Country country;
+
+    @BeforeEach
+    public void setUp() {
+        country = new Country();
+    }
+
+    @Test
+    public void getIdTest() {
+        assertNull(country.getId());
+    }
+
+    @Test
+    public void setIdTest() {
+        Long id = GetRandomLong();
+        country.setId(id);
+        assertEquals(id, country.getId());
+    }
+
+    @Test
+    public void getNameTest() {
+        assertNull(country.getName());
+    }
+
+    @Test
+    public void setLastNameTest() {
+        String name = GetRandomString();
+        country.setName(name);
+        assertEquals(name, country.getName());
+    }
+
+
+}