@@ -89,6 +89,55 @@ void testCopyAllNoReplace() {
89
89
assertEquals (expected , actual );
90
90
}
91
91
92
+ @ Test
93
+ void testCopyAllActionsNoReplace () {
94
+ GUI expected = GUI .newGUI (9 ).setTitle ("Hello" )
95
+ .setVariable ("hello" , "world" )
96
+ .setContents (0 , ItemGUIContent .newInstance ("stone" ))
97
+ .addContent (ItemGUIContent .newInstance ("diamond" ))
98
+ .onOpenGUI ("command" )
99
+ .onChangeGUI ("command" )
100
+ .onCloseGUI ("command" )
101
+ .onClickOutside ("command" );
102
+ GUI actual = GUI .newGUI (9 ).setTitle ("Hi" ).copyFrom (expected , false );
103
+ assertEquals ("Hi" , actual .getTitle ());
104
+ actual .setTitle (expected .getTitle ())
105
+ .onOpenGUI ("command" )
106
+ .onChangeGUI ("command" )
107
+ .onCloseGUI ("command" )
108
+ .onClickOutside ("command" );
109
+ assertEquals (expected , actual );
110
+ }
111
+
112
+ @ Test
113
+ void testCopyAllActionsOnActualNoReplace () {
114
+ GUI expected = GUI .newGUI (9 ).setTitle ("Hello" )
115
+ .setVariable ("hello" , "world" )
116
+ .setContents (0 , ItemGUIContent .newInstance ("stone" ))
117
+ .addContent (ItemGUIContent .newInstance ("diamond" ))
118
+ .onOpenGUI ("command" )
119
+ .onChangeGUI ("command" )
120
+ .onCloseGUI ("command" )
121
+ .onClickOutside ("command" );
122
+ GUI actual = GUI .newGUI (9 ).setTitle ("Hi" )
123
+ .onOpenGUI ("command1" )
124
+ .onChangeGUI ("command1" )
125
+ .onCloseGUI ("command1" )
126
+ .onClickOutside ("command1" )
127
+ .copyFrom (expected , false );
128
+ assertEquals ("Hi" , actual .getTitle ());
129
+ assertNotEquals (actual .openGUIAction ().get (), expected .openGUIAction ().get ());
130
+ assertNotEquals (actual .changeGUIAction ().get (), expected .changeGUIAction ().get ());
131
+ assertNotEquals (actual .closeGUIAction ().get (), expected .closeGUIAction ().get ());
132
+ assertNotEquals (actual .clickOutsideAction ().get (), expected .clickOutsideAction ().get ());
133
+ actual .setTitle (expected .getTitle ())
134
+ .onOpenGUI ("command" )
135
+ .onChangeGUI ("command" )
136
+ .onCloseGUI ("command" )
137
+ .onClickOutside ("command" );
138
+ assertEquals (expected , actual );
139
+ }
140
+
92
141
@ Test
93
142
void testCopyAllReplace () {
94
143
GUI expected = GUI .newGUI (9 ).setTitle ("Hello" )
@@ -100,6 +149,25 @@ void testCopyAllReplace() {
100
149
assertEquals (expected , actual );
101
150
}
102
151
152
+ @ Test
153
+ void testCopyAllActionsOnActualAllReplace () {
154
+ GUI expected = GUI .newGUI (9 ).setTitle ("Hello" )
155
+ .setVariable ("hello" , "world" )
156
+ .setContents (0 , ItemGUIContent .newInstance ("stone" ))
157
+ .addContent (ItemGUIContent .newInstance ("diamond" ))
158
+ .onOpenGUI ("command" )
159
+ .onChangeGUI ("command" )
160
+ .onCloseGUI ("command" )
161
+ .onClickOutside ("command" );
162
+ GUI actual = GUI .newGUI (9 ).setTitle ("Hi" )
163
+ .onOpenGUI ("command1" )
164
+ .onChangeGUI ("command1" )
165
+ .onCloseGUI ("command1" )
166
+ .onClickOutside ("command1" )
167
+ .copyFrom (expected , true );
168
+ assertEquals (expected , actual );
169
+ }
170
+
103
171
@ Test
104
172
void testCopyDifferentSizes () {
105
173
assertThrowsExactly (IllegalArgumentException .class , () ->
0 commit comments