Browse Source

Fix tests compilation errors

dotnet3-migration/reorganize-folders
Miguel Veloso 5 years ago
parent
commit
4b48468d6a
4 changed files with 7 additions and 7 deletions
  1. +1
    -1
      src/Tests/Services/Application.FunctionalTests/Services/Catalog/CatalogScenariosBase.cs
  2. +4
    -4
      src/Tests/Services/Application.FunctionalTests/Services/IntegrationEventsScenarios.cs
  3. +1
    -1
      src/Tests/Services/Application.FunctionalTests/Services/Ordering/OrderingScenarios.cs
  4. +1
    -1
      src/Tests/Services/Application.FunctionalTests/Services/Ordering/OrderingScenariosBase.cs

+ 1
- 1
src/Tests/Services/Application.FunctionalTests/Services/Catalog/CatalogScenariosBase.cs View File

@ -33,7 +33,7 @@ namespace FunctionalTests.Services.Catalog
testServer.Host
.MigrateDbContext<CatalogContext>((context, services) =>
{
var env = services.GetService<IHostingEnvironment>();
var env = services.GetService<IWebHostEnvironment>();
var settings = services.GetService<IOptions<CatalogSettings>>();
var logger = services.GetService<ILogger<CatalogContextSeed>>();


+ 4
- 4
src/Tests/Services/Application.FunctionalTests/Services/IntegrationEventsScenarios.cs View File

@ -56,7 +56,7 @@ namespace FunctionalTests.Services
else
{
//THEN the product price changes in the catalog
Assert.Equal(newPrice, modifiedCatalogProducts.Data.Single(it => it.Id == int.Parse(itemToModify.ProductId)).Price);
Assert.Equal(newPrice, modifiedCatalogProducts.Data.Single(it => it.Id == itemToModify.ProductId).Price);
// AND the products in the basket reflects the changed priced and the original price
Assert.Equal(newPrice, itemUpdated.UnitPrice);
@ -65,7 +65,7 @@ namespace FunctionalTests.Services
}
}
private async Task<BasketItem> GetUpdatedBasketItem(decimal newPrice, string productId, string userId, HttpClient basketClient)
private async Task<BasketItem> GetUpdatedBasketItem(decimal newPrice, int productId, string userId, HttpClient basketClient)
{
bool continueLoop = true;
var counter = 0;
@ -102,7 +102,7 @@ namespace FunctionalTests.Services
private string ChangePrice(BasketItem itemToModify, decimal newPrice, PaginatedItemsViewModel<CatalogItem> catalogProducts)
{
var catalogProduct = catalogProducts.Data.Single(pr => pr.Id == int.Parse(itemToModify.ProductId));
var catalogProduct = catalogProducts.Data.Single(pr => pr.Id == itemToModify.ProductId);
catalogProduct.Price = newPrice;
return JsonConvert.SerializeObject(catalogProduct);
}
@ -117,7 +117,7 @@ namespace FunctionalTests.Services
Id = Guid.NewGuid().ToString(),
UnitPrice = item.Price,
PictureUrl = item.PictureUri,
ProductId = item.Id.ToString(),
ProductId = item.Id,
OldUnitPrice = 0,
ProductName = item.Name,
Quantity = 1


+ 1
- 1
src/Tests/Services/Application.FunctionalTests/Services/Ordering/OrderingScenarios.cs View File

@ -104,7 +104,7 @@ namespace FunctionalTests.Services.Ordering
{
Id = "1",
ProductName = "ProductName",
ProductId = "1",
ProductId = 1,
UnitPrice = 10,
Quantity = 1
}


+ 1
- 1
src/Tests/Services/Application.FunctionalTests/Services/Ordering/OrderingScenariosBase.cs View File

@ -33,7 +33,7 @@ namespace FunctionalTests.Services.Ordering
testServer.Host
.MigrateDbContext<OrderingContext>((context, services) =>
{
var env = services.GetService<IHostingEnvironment>();
var env = services.GetService<IWebHostEnvironment>();
var settings = services.GetService<IOptions<OrderingSettings>>();
var logger = services.GetService<ILogger<OrderingContextSeed>>();


Loading…
Cancel
Save