Make more tests pass
This commit is contained in:
		
							parent
							
								
									f3d2843166
								
							
						
					
					
						commit
						746e5da7fa
					
				| @ -6,23 +6,6 @@ namespace Basket.FunctionalTests.Base; | |||||||
| public class BasketScenarioBase : WebApplicationFactory<Program> | public class BasketScenarioBase : WebApplicationFactory<Program> | ||||||
| { | { | ||||||
|     private const string ApiUrlBase = "api/v1/basket"; |     private const string ApiUrlBase = "api/v1/basket"; | ||||||
| 
 |  | ||||||
|     public TestServer CreateServer() |  | ||||||
|     { |  | ||||||
|         var path = Assembly.GetAssembly(typeof(BasketScenarioBase)) |  | ||||||
|             .Location; |  | ||||||
| 
 |  | ||||||
|         var hostBuilder = new WebHostBuilder() |  | ||||||
|             .UseContentRoot(Path.GetDirectoryName(path)) |  | ||||||
|             .ConfigureAppConfiguration(cb => |  | ||||||
|             { |  | ||||||
|                 cb.AddJsonFile("appsettings.json", optional: false) |  | ||||||
|                 .AddEnvironmentVariables(); |  | ||||||
|             }); |  | ||||||
| 
 |  | ||||||
|         return new TestServer(hostBuilder); |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     public static class Get |     public static class Get | ||||||
|     { |     { | ||||||
|         public static string GetBasket(int id) |         public static string GetBasket(int id) | ||||||
|  | |||||||
| @ -9,8 +9,7 @@ namespace Basket.FunctionalTests | |||||||
|         [Fact] |         [Fact] | ||||||
|         public async Task UpdateBasket_return_and_add_basket() |         public async Task UpdateBasket_return_and_add_basket() | ||||||
|         { |         { | ||||||
|             using var server = CreateServer(); |             var redis = Services.GetRequiredService<ConnectionMultiplexer>(); | ||||||
|             var redis = server.Host.Services.GetRequiredService<ConnectionMultiplexer>(); |  | ||||||
| 
 | 
 | ||||||
|             var redisBasketRepository = BuildBasketRepository(redis); |             var redisBasketRepository = BuildBasketRepository(redis); | ||||||
| 
 | 
 | ||||||
| @ -29,9 +28,7 @@ namespace Basket.FunctionalTests | |||||||
|         [Fact] |         [Fact] | ||||||
|         public async Task Delete_Basket_return_null() |         public async Task Delete_Basket_return_null() | ||||||
|         { |         { | ||||||
| 
 |             var redis = Services.GetRequiredService<ConnectionMultiplexer>(); | ||||||
|             using var server = CreateServer(); |  | ||||||
|             var redis = server.Host.Services.GetRequiredService<ConnectionMultiplexer>(); |  | ||||||
| 
 | 
 | ||||||
|             var redisBasketRepository = BuildBasketRepository(redis); |             var redisBasketRepository = BuildBasketRepository(redis); | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user