Functional test is added that partially tests CompleteOrderAsync action
This commit is contained in:
		
							parent
							
								
									ba8bbe71df
								
							
						
					
					
						commit
						979d4ff01d
					
				| @ -50,6 +50,7 @@ public class OrderingScenarioBase | |||||||
|     { |     { | ||||||
|         public static string CancelOrder = "api/v1/orders/cancel"; |         public static string CancelOrder = "api/v1/orders/cancel"; | ||||||
|         public static string ShipOrder = "api/v1/orders/ship"; |         public static string ShipOrder = "api/v1/orders/ship"; | ||||||
|  |         public static string CompleteOrder = "api/v1/orders/complete"; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     private class AuthStartupFilter : IStartupFilter |     private class AuthStartupFilter : IStartupFilter | ||||||
|  | |||||||
| @ -19,6 +19,20 @@ namespace Ordering.FunctionalTests | |||||||
|             response.EnsureSuccessStatusCode(); |             response.EnsureSuccessStatusCode(); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  |         [Fact] | ||||||
|  |         public async Task Complete_order_no_order_created_bad_request_response() | ||||||
|  |         { | ||||||
|  |             using var server = CreateServer(); | ||||||
|  |             var content = new StringContent(BuildOrder(), UTF8Encoding.UTF8, "application/json") | ||||||
|  |             { | ||||||
|  |                 Headers = { { "x-requestid", Guid.NewGuid().ToString() } } | ||||||
|  |             }; | ||||||
|  |             var response = await server.CreateClient() | ||||||
|  |                 .PutAsync(Put.CompleteOrder, content); | ||||||
|  | 
 | ||||||
|  |             Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|         [Fact] |         [Fact] | ||||||
|         public async Task Cancel_order_no_order_created_bad_request_response() |         public async Task Cancel_order_no_order_created_bad_request_response() | ||||||
|         { |         { | ||||||
| @ -30,7 +44,6 @@ namespace Ordering.FunctionalTests | |||||||
|             var response = await server.CreateClient() |             var response = await server.CreateClient() | ||||||
|                 .PutAsync(Put.CancelOrder, content); |                 .PutAsync(Put.CancelOrder, content); | ||||||
|   |   | ||||||
|             var s = await response.Content.ReadAsStringAsync(); |  | ||||||
|             Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode); |             Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user