7
7
8
8
namespace Microsoft . Azure . Durable . Tests . DotnetIsolatedE2E ;
9
9
10
- [ Collection ( Constants . FunctionAppCollectionName ) ]
10
+ [ Collection ( Constants . FunctionAppCollectionName ) ]
11
11
public class HttpEndToEndTests
12
12
{
13
13
private readonly FunctionAppFixture _fixture ;
@@ -19,17 +19,34 @@ public HttpEndToEndTests(FunctionAppFixture fixture, ITestOutputHelper testOutpu
19
19
}
20
20
21
21
[ Theory ]
22
- [ InlineData ( "HelloCities_HttpStart" , "" , HttpStatusCode . Accepted , "" ) ]
23
- public async Task HttpTriggerTests ( string functionName , string queryString , HttpStatusCode expectedStatusCode , string expectedMessage )
22
+ [ InlineData ( "HelloCities_HttpStart" , HttpStatusCode . Accepted ) ]
23
+ public async Task HttpTriggerTests ( string functionName , HttpStatusCode expectedStatusCode )
24
24
{
25
- using HttpResponseMessage response = await HttpHelpers . InvokeHttpTrigger ( functionName , queryString ) ;
25
+ using HttpResponseMessage response = await HttpHelpers . InvokeHttpTrigger ( functionName , "" ) ;
26
26
string actualMessage = await response . Content . ReadAsStringAsync ( ) ;
27
27
28
28
Assert . Equal ( expectedStatusCode , response . StatusCode ) ;
29
+ Assert . False ( string . IsNullOrEmpty ( actualMessage ) ) ;
30
+ }
31
+
32
+ [ Theory ]
33
+ [ InlineData ( "HelloCities_HttpStart_Scheduled" , HttpStatusCode . Accepted ) ]
34
+ public async Task ScheduledStartTests ( string functionName , HttpStatusCode expectedStatusCode )
35
+ {
36
+ var scheduledStartDate = DateTime . Now + TimeSpan . FromSeconds ( 10 ) ;
37
+
38
+ using HttpResponseMessage response = await HttpHelpers . InvokeHttpTrigger ( functionName , $ "?ScheduledStartTime={ scheduledStartDate . ToString ( "o" ) } ") ;
39
+ string actualMessage = await response . Content . ReadAsStringAsync ( ) ;
40
+
41
+ string statusQueryGetUri = DurableHelpers . ParseStatusQueryGetUri ( response ) ;
42
+
43
+ Assert . Equal ( expectedStatusCode , response . StatusCode ) ;
44
+
45
+ string startRuntimeStatus = DurableHelpers . GetRuntimeStatus ( statusQueryGetUri ) ;
46
+ Assert . Equal ( "Pending" , startRuntimeStatus ) ;
47
+ Thread . Sleep ( 11000 ) ;
29
48
30
- if ( ! string . IsNullOrEmpty ( expectedMessage ) )
31
- {
32
- Assert . False ( string . IsNullOrEmpty ( actualMessage ) ) ;
33
- }
49
+ string endRuntimeStatus = DurableHelpers . GetRuntimeStatus ( statusQueryGetUri ) ;
50
+ Assert . Equal ( "Completed" , endRuntimeStatus ) ;
34
51
}
35
52
}
0 commit comments