You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1002 B

  1. using Microsoft.AspNetCore;
  2. using Microsoft.AspNetCore.Hosting;
  3. using Microsoft.AspNetCore.TestHost;
  4. using System.IO;
  5. namespace Ordering.FunctionalTests.Base
  6. {
  7. class BasketScenariosBase
  8. {
  9. private const string ApiUrlBase = "api/v1/basket";
  10. public TestServer CreateServer()
  11. {
  12. var webHostBuilder = WebHost.CreateDefaultBuilder();
  13. webHostBuilder.UseContentRoot(Directory.GetCurrentDirectory() + "\\Services\\Basket");
  14. webHostBuilder.UseStartup<BasketTestsStartup>();
  15. return new TestServer(webHostBuilder);
  16. }
  17. public static class Get
  18. {
  19. public static string GetBasketByCustomer(string customerId)
  20. {
  21. return $"{ApiUrlBase}/{customerId}";
  22. }
  23. }
  24. public static class Post
  25. {
  26. public static string CreateBasket = $"{ApiUrlBase}/";
  27. public static string Checkout = $"{ApiUrlBase}/checkout";
  28. }
  29. }
  30. }