1- using System ;
2- using System . Collections . Generic ;
1+ using System . Collections . Generic ;
32using CommandLine ;
43using InEngine . Core ;
54using InEngine . Core . Commands ;
65using InEngine . Core . Scheduling ;
76
8- namespace InEngine . Commands
7+ namespace InEngine . Commands ;
8+
9+ public class CommandsPlugin : AbstractPlugin
910{
10- public class CommandsPlugin : AbstractPlugin
11- {
12- [ VerbOption ( "fail" , HelpText = "Always fail. Useful for end-to-end testing." ) ]
13- public AlwaysFail AlwaysFail { get ; set ; }
11+ [ VerbOption ( "fail" , HelpText = "Always fail. Useful for end-to-end testing." ) ]
12+ public AlwaysFail AlwaysFail { get ; set ; }
1413
15- [ VerbOption ( "succeed" , HelpText = "A null operation command. Literally does nothing." ) ]
16- public AlwaysSucceed Null { get ; set ; }
14+ [ VerbOption ( "succeed" , HelpText = "A null operation command. Literally does nothing." ) ]
15+ public AlwaysSucceed Null { get ; set ; }
1716
18- public override void Schedule ( ISchedule schedule )
19- {
20- schedule . Command ( new Echo { VerbatimText = "Core Echo command." } )
21- . EverySecond ( )
22- . Before ( x => Console . WriteLine ( "Before" ) )
23- . After ( x => Console . WriteLine ( "After" ) )
24- . PingBefore ( "http ://www.google.com" )
25- . PingAfter ( "http ://www.google.com" )
26- . WriteOutputTo ( "AlwaysSucceedWrite.log" )
27- . AppendOutputTo ( "AlwaysSucceedAppend.log" )
28- . EmailOutputTo ( "example@inengine.net" ) ;
17+ public override void Schedule ( ISchedule schedule )
18+ {
19+ schedule . Command ( new Echo { VerbatimText = "Core Echo command." } )
20+ . EveryMinute ( )
21+ . Before ( x => x . Line ( $ "Before { x . Name } ") )
22+ . After ( x => x . Line ( $ "After { x . Name } ") )
23+ . PingBefore ( "https ://www.google.com" )
24+ . PingAfter ( "https ://www.google.com" )
25+ . WriteOutputTo ( "AlwaysSucceedWrite.log" )
26+ . AppendOutputTo ( "AlwaysSucceedAppend.log" )
27+ . EmailOutputTo ( "example@inengine.net" ) ;
2928
30- schedule . Command ( new [ ] {
31- new Echo { VerbatimText = "Chain Link 1" } ,
32- new Echo { VerbatimText = "Chain Link 2" } ,
33- } ) . EverySecond ( ) ;
29+ schedule . Command ( new AbstractCommand [ ] {
30+ new Echo { VerbatimText = "Chain Link 1" } ,
31+ new Echo { VerbatimText = "Chain Link 2" } ,
32+ } ) . EveryFiveMinutes ( ) ;
3433
35- schedule . Command ( new List < AbstractCommand > {
36- new Echo { VerbatimText = "Chain Link A" } ,
37- new AlwaysFail ( ) ,
38- new Echo { VerbatimText = "Chain Link C" } ,
39- } ) . EverySecond ( ) ;
40- }
34+ schedule . Command ( new List < AbstractCommand > {
35+ new Echo { VerbatimText = "Chain Link A" } ,
36+ new AlwaysFail ( ) ,
37+ new Echo { VerbatimText = "Chain Link C" } ,
38+ } ) . EveryFifteenMinutes ( ) ;
4139 }
42- }
40+ }
0 commit comments