@@ -85,26 +85,13 @@ public void TestVibrateCmd()
8585 ( Encoding . ASCII . GetBytes ( "Vibrate:10;" ) , testUtil . NoCharacteristic ) ,
8686 } ;
8787
88- testUtil . TestDeviceMessage (
89- new VibrateCmd ( 4 , new List < VibrateCmd . VibrateSubcommand > ( )
90- {
91- new VibrateCmd . VibrateSubcommand ( 0 , 0.5 ) ,
92- } ) , expected , false ) ;
88+ testUtil . TestDeviceMessage ( VibrateCmd . Create ( 4 , 1 , 0.5 , 1 ) , expected , false ) ;
9389 }
9490
9591 [ Test ]
9692 public void TestInvalidVibrateCmd ( )
9793 {
98- testUtil . TestInvalidDeviceMessage (
99- new VibrateCmd ( 4 , new List < VibrateCmd . VibrateSubcommand > ( )
100- {
101- } ) ) ;
102- testUtil . TestInvalidDeviceMessage (
103- new VibrateCmd ( 4 , new List < VibrateCmd . VibrateSubcommand > ( )
104- {
105- new VibrateCmd . VibrateSubcommand ( 0 , 0.5 ) ,
106- new VibrateCmd . VibrateSubcommand ( 1 , 0.5 ) ,
107- } ) ) ;
94+ testUtil . TestInvalidVibrateCmd ( 1 ) ;
10895 }
10996 }
11097
@@ -187,28 +174,13 @@ public void TestVibrateCmd()
187174 ( Encoding . ASCII . GetBytes ( "Vibrate2:10;" ) , testUtil . NoCharacteristic ) ,
188175 } ;
189176
190- testUtil . TestDeviceMessage (
191- new VibrateCmd ( 4 , new List < VibrateCmd . VibrateSubcommand > ( )
192- {
193- new VibrateCmd . VibrateSubcommand ( 0 , 0.5 ) ,
194- new VibrateCmd . VibrateSubcommand ( 1 , 0.5 ) ,
195- } ) , expected , false ) ;
177+ testUtil . TestDeviceMessage ( VibrateCmd . Create ( 4 , 1 , 0.5 , 2 ) , expected , false ) ;
196178 }
197179
198180 [ Test ]
199181 public void TestInvalidVibrateCmd ( )
200182 {
201- testUtil . TestInvalidDeviceMessage (
202- new VibrateCmd ( 4 , new List < VibrateCmd . VibrateSubcommand > ( )
203- {
204- } ) ) ;
205- testUtil . TestInvalidDeviceMessage (
206- new VibrateCmd ( 4 , new List < VibrateCmd . VibrateSubcommand > ( )
207- {
208- new VibrateCmd . VibrateSubcommand ( 0 , 0.5 ) ,
209- new VibrateCmd . VibrateSubcommand ( 1 , 0.5 ) ,
210- new VibrateCmd . VibrateSubcommand ( 2 , 0.5 ) ,
211- } ) ) ;
183+ testUtil . TestInvalidVibrateCmd ( 2 ) ;
212184 }
213185 }
214186
@@ -256,11 +228,7 @@ public void TestStopDeviceCmd()
256228 ( Encoding . ASCII . GetBytes ( "Rotate:10;" ) , testUtil . NoCharacteristic ) ,
257229 } ;
258230
259- testUtil . TestDeviceMessage (
260- new RotateCmd ( 4 , new List < RotateCmd . RotateSubcommand > ( )
261- {
262- new RotateCmd . RotateSubcommand ( 0 , 0.5 , true ) ,
263- } ) , expected , false ) ;
231+ testUtil . TestDeviceMessage ( RotateCmd . Create ( 4 , 1 , 0.5 , true , 1 ) , expected , false ) ;
264232
265233 expected =
266234 new List < ( byte [ ] , uint ) > ( )
@@ -280,38 +248,22 @@ public void TestRotateCmd()
280248 ( Encoding . ASCII . GetBytes ( "Rotate:10;" ) , testUtil . NoCharacteristic ) ,
281249 } ;
282250
283- testUtil . TestDeviceMessage (
284- new RotateCmd ( 4 , new List < RotateCmd . RotateSubcommand > ( )
285- {
286- new RotateCmd . RotateSubcommand ( 0 , 0.5 , true ) ,
287- } ) , expected , false ) ;
251+ testUtil . TestDeviceMessage ( RotateCmd . Create ( 4 , 1 , 0.5 , true , 1 ) , expected , false ) ;
288252
289253 expected =
290254 new List < ( byte [ ] , uint ) > ( )
291255 {
292256 ( Encoding . ASCII . GetBytes ( "RotateChange;" ) , testUtil . NoCharacteristic ) ,
293257 } ;
294258
295- testUtil . TestDeviceMessage (
296- new RotateCmd ( 4 , new List < RotateCmd . RotateSubcommand > ( )
297- {
298- new RotateCmd . RotateSubcommand ( 0 , 0.5 , false ) ,
299- } ) , expected , false ) ;
259+ testUtil . TestDeviceMessage ( RotateCmd . Create ( 4 , 1 , 0.5 , false , 1 ) , expected , false ) ;
300260 }
301261
302262 [ Test ]
303263 public void TestInvalidVibrateCmd ( )
304264 {
305- testUtil . TestInvalidDeviceMessage (
306- new VibrateCmd ( 4 , new List < VibrateCmd . VibrateSubcommand > ( )
307- {
308- } ) ) ;
309- testUtil . TestInvalidDeviceMessage (
310- new VibrateCmd ( 4 , new List < VibrateCmd . VibrateSubcommand > ( )
311- {
312- new VibrateCmd . VibrateSubcommand ( 0 , 0.5 ) ,
313- new VibrateCmd . VibrateSubcommand ( 1 , 0.5 ) ,
314- } ) ) ;
265+ testUtil . TestInvalidDeviceMessage ( RotateCmd . Create ( 4 , 1 , 0.5 , true , 0 ) ) ;
266+ testUtil . TestInvalidDeviceMessage ( RotateCmd . Create ( 4 , 1 , 0.5 , true , 2 ) ) ;
315267 testUtil . TestInvalidDeviceMessage (
316268 new VibrateCmd ( 4 , new List < VibrateCmd . VibrateSubcommand > ( )
317269 {
0 commit comments