bengbengbalabalabeng commented on code in PR #810:
URL: https://github.com/apache/fesod/pull/810#discussion_r3412919675


##########
fesod-sheet/src/test/java/org/apache/fesod/sheet/writesheet/WriteTableTest.java:
##########
@@ -0,0 +1,247 @@
+package org.apache.fesod.sheet.writesheet;
+
+import java.io.File;
+import java.lang.reflect.Field;
+import java.util.*;
+import org.apache.fesod.sheet.ExcelWriter;
+import org.apache.fesod.sheet.FesodSheet;
+import org.apache.fesod.sheet.annotation.ExcelProperty;
+import org.apache.fesod.sheet.support.ExcelTypeEnum;
+import org.apache.fesod.sheet.util.TestFileUtil;
+import org.apache.fesod.sheet.write.builder.ExcelWriterBuilder;
+import org.apache.fesod.sheet.write.builder.ExcelWriterSheetBuilder;
+import org.apache.fesod.sheet.write.metadata.WriteSheet;
+import org.apache.fesod.sheet.write.metadata.WriteTable;
+import org.apache.poi.ss.usermodel.*;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.EnumSource;
+
+public class WriteTableTest {
+
+    private static final String HEADER_STRING;
+
+    static {
+        try {
+            Field field = WriteSheetData.class.getDeclaredField("string");
+            ExcelProperty annotation = 
field.getAnnotation(ExcelProperty.class);
+            HEADER_STRING = annotation.value()[0];
+        } catch (Exception e) {
+            throw new RuntimeException("Failed to resolve @ExcelProperty 
header from WriteSheetData.string", e);
+        }
+    }
+
+    @ParameterizedTest
+    @EnumSource(
+            value = ExcelTypeEnum.class,
+            names = {"XLS", "XLSX"})
+    public void testWriteTableWithTitle(ExcelTypeEnum excelType) throws 
Exception {
+        Random random = new Random();

Review Comment:
   Random numbers may lead to non-deterministic, it is recommended to use 
@MethodSource to provide N sets of representative boundary values for testing.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to