yangys
2025-08-14 6043e2e1c832db2bf7bb1868ae9ca727f7b988b3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package org.springblade.mdm.program.service;
 
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.springblade.system.pojo.entity.Dict;
 
import java.util.Arrays;
import java.util.List;
 
public class ProgramAnnotationServiceTest {
 
    @Test
    public void testIsAnnotation(){
        ProgramAnnotationService s = new ProgramAnnotationService();
        Dict fanucDict = new Dict();
        fanucDict.setCode("machine_annotation");
        fanucDict.setDictKey("FANUC");
        fanucDict.setRemark("(,)");
 
        Dict xmz = new Dict();
        xmz.setCode("machine_annotation");
        xmz.setDictKey("XIMENZI");
        xmz.setRemark("*-,");
 
        List<Dict> dictList = Arrays.asList(fanucDict, xmz);
        Assertions.assertTrue(s.isAnnotation("(abc)","FANUC", dictList));
 
        Assertions.assertFalse(s.isAnnotation("*-","FANUC",dictList));
 
        Assertions.assertTrue(s.isAnnotation("*-","XIMENZI", dictList));
    }
 
    @Test
    public void testIsAnnotation2(){
        ProgramAnnotationService s = new ProgramAnnotationService();
        Dict fanucDict = new Dict();
        fanucDict.setCode("machine_annotation");
        fanucDict.setDictKey("FANUC");
        fanucDict.setRemark("(,)");
 
        Dict xmz = new Dict();
        xmz.setCode("machine_annotation");
        xmz.setDictKey("XIMENZI");
        xmz.setRemark("*-,");
        List<Dict> dictList = Arrays.asList(fanucDict, xmz);
 
        Assertions.assertEquals("(A)",s.generateAnnotation("A","FANUC",dictList));
 
 
        Assertions.assertEquals("*-A",s.generateAnnotation("A","XIMENZI",dictList));
    }
}