@@ -52,15 +52,15 @@ public void GetAzureAutomationJobByRunbookNameSuccessfull()
52
52
string accountName = "automation" ;
53
53
string runbookName = "runbook" ;
54
54
55
- this . mockAutomationClient . Setup ( f => f . ListJobsByRunbookName ( accountName , runbookName , null , null ) ) ;
55
+ this . mockAutomationClient . Setup ( f => f . ListJobsByRunbookName ( accountName , runbookName , null , null , null ) ) ;
56
56
57
57
// Test
58
58
this . cmdlet . AutomationAccountName = accountName ;
59
59
this . cmdlet . RunbookName = runbookName ;
60
60
this . cmdlet . ExecuteCmdlet ( ) ;
61
61
62
62
// Assert
63
- this . mockAutomationClient . Verify ( f => f . ListJobsByRunbookName ( accountName , runbookName , null , null ) , Times . Once ( ) ) ;
63
+ this . mockAutomationClient . Verify ( f => f . ListJobsByRunbookName ( accountName , runbookName , null , null , null ) , Times . Once ( ) ) ;
64
64
}
65
65
66
66
public void GetAzureAutomationJobByRunbookNamAndStartTimeEndTimeeSuccessfull ( )
@@ -71,15 +71,36 @@ public void GetAzureAutomationJobByRunbookNamAndStartTimeEndTimeeSuccessfull()
71
71
DateTime startTime = new DateTime ( 2014 , 12 , 30 , 17 , 0 , 0 , 0 ) ;
72
72
DateTime endTime = new DateTime ( 2014 , 12 , 30 , 18 , 0 , 0 , 0 ) ;
73
73
74
- this . mockAutomationClient . Setup ( f => f . ListJobsByRunbookName ( accountName , runbookName , startTime , endTime ) ) ;
74
+ this . mockAutomationClient . Setup ( f => f . ListJobsByRunbookName ( accountName , runbookName , startTime , endTime , null ) ) ;
75
75
76
76
// Test
77
77
this . cmdlet . AutomationAccountName = accountName ;
78
78
this . cmdlet . RunbookName = runbookName ;
79
79
this . cmdlet . ExecuteCmdlet ( ) ;
80
80
81
81
// Assert
82
- this . mockAutomationClient . Verify ( f => f . ListJobsByRunbookName ( accountName , runbookName , startTime , endTime ) , Times . Once ( ) ) ;
82
+ this . mockAutomationClient . Verify ( f => f . ListJobsByRunbookName ( accountName , runbookName , startTime , endTime , null ) , Times . Once ( ) ) ;
83
+ }
84
+
85
+ public void GetAzureAutomationCompletedJobByRunbookNamAndStartTimeEndTimeeSuccessfull ( )
86
+ {
87
+ // Setup
88
+ string accountName = "automation" ;
89
+ string runbookName = "runbook" ;
90
+ DateTime startTime = new DateTime ( 2014 , 12 , 30 , 17 , 0 , 0 , 0 ) ;
91
+ DateTime endTime = new DateTime ( 2014 , 12 , 30 , 18 , 0 , 0 , 0 ) ;
92
+ string status = "Completed" ;
93
+
94
+ this . mockAutomationClient . Setup ( f => f . ListJobsByRunbookName ( accountName , runbookName , startTime , endTime , status ) ) ;
95
+
96
+ // Test
97
+ this . cmdlet . AutomationAccountName = accountName ;
98
+ this . cmdlet . RunbookName = runbookName ;
99
+ this . cmdlet . Status = status ;
100
+ this . cmdlet . ExecuteCmdlet ( ) ;
101
+
102
+ // Assert
103
+ this . mockAutomationClient . Verify ( f => f . ListJobsByRunbookName ( accountName , runbookName , startTime , endTime , status ) , Times . Once ( ) ) ;
83
104
}
84
105
85
106
[ TestMethod ]
@@ -88,14 +109,14 @@ public void GetAzureAutomationAllJobsSuccessfull()
88
109
// Setup
89
110
string accountName = "automation" ;
90
111
91
- this . mockAutomationClient . Setup ( f => f . ListJobs ( accountName , null , null ) ) ;
112
+ this . mockAutomationClient . Setup ( f => f . ListJobs ( accountName , null , null , null ) ) ;
92
113
93
114
// Test
94
115
this . cmdlet . AutomationAccountName = accountName ;
95
116
this . cmdlet . ExecuteCmdlet ( ) ;
96
117
97
118
// Assert
98
- this . mockAutomationClient . Verify ( f => f . ListJobs ( accountName , null , null ) , Times . Once ( ) ) ;
119
+ this . mockAutomationClient . Verify ( f => f . ListJobs ( accountName , null , null , null ) , Times . Once ( ) ) ;
99
120
}
100
121
101
122
[ TestMethod ]
@@ -107,7 +128,7 @@ public void GetAzureAutomationAllJobsBetweenStartAndEndTimeSuccessfull()
107
128
DateTime endTime = new DateTime ( 2014 , 12 , 30 , 18 , 0 , 0 , 0 ) ;
108
129
109
130
// look for jobs between 5pm to 6pm on 30th december 2014
110
- this . mockAutomationClient . Setup ( f => f . ListJobs ( accountName , startTime , endTime ) ) ;
131
+ this . mockAutomationClient . Setup ( f => f . ListJobs ( accountName , startTime , endTime , null ) ) ;
111
132
112
133
// Test
113
134
this . cmdlet . AutomationAccountName = accountName ;
@@ -116,7 +137,30 @@ public void GetAzureAutomationAllJobsBetweenStartAndEndTimeSuccessfull()
116
137
this . cmdlet . ExecuteCmdlet ( ) ;
117
138
118
139
// Assert
119
- this . mockAutomationClient . Verify ( f => f . ListJobs ( accountName , startTime , endTime ) , Times . Once ( ) ) ;
140
+ this . mockAutomationClient . Verify ( f => f . ListJobs ( accountName , startTime , endTime , null ) , Times . Once ( ) ) ;
141
+ }
142
+
143
+ [ TestMethod ]
144
+ public void GetAzureAutomationAllCompletedJobsBetweenStartAndEndTimeSuccessfull ( )
145
+ {
146
+ // Setup
147
+ string accountName = "automation" ;
148
+ DateTime startTime = new DateTime ( 2014 , 12 , 30 , 17 , 0 , 0 , 0 ) ;
149
+ DateTime endTime = new DateTime ( 2014 , 12 , 30 , 18 , 0 , 0 , 0 ) ;
150
+ string status = "Completed" ;
151
+
152
+ // look for jobs between 5pm to 6pm on 30th december 2014
153
+ this . mockAutomationClient . Setup ( f => f . ListJobs ( accountName , startTime , endTime , status ) ) ;
154
+
155
+ // Test
156
+ this . cmdlet . AutomationAccountName = accountName ;
157
+ this . cmdlet . StartTime = startTime ;
158
+ this . cmdlet . EndTime = endTime ;
159
+ this . cmdlet . Status = status ;
160
+ this . cmdlet . ExecuteCmdlet ( ) ;
161
+
162
+ // Assert
163
+ this . mockAutomationClient . Verify ( f => f . ListJobs ( accountName , startTime , endTime , status ) , Times . Once ( ) ) ;
120
164
}
121
165
122
166
public void GetAzureAutomationJobByIdSuccessfull ( )
@@ -136,5 +180,6 @@ public void GetAzureAutomationJobByIdSuccessfull()
136
180
// Assert
137
181
this . mockAutomationClient . Verify ( f => f . GetJob ( accountName , jobId ) , Times . Once ( ) ) ;
138
182
}
183
+
139
184
}
140
185
}
0 commit comments