Fix failing tests

This commit is contained in:
Ramón Tomás 2017-05-10 11:26:45 +02:00
parent c33a6ecdf0
commit b8f01a9199
4 changed files with 7 additions and 5 deletions

View File

@ -32,9 +32,9 @@ namespace FunctionalTests.Services.Catalog
} }
} }
public static class Post public static class Put
{ {
public static string UpdateCatalogProduct = "api/v1/catalog/update"; public static string UpdateCatalogProduct = "api/v1/catalog/items";
} }
} }
} }

View File

@ -43,7 +43,7 @@ namespace FunctionalTests.Services
var itemToModify = basket.Items[2]; var itemToModify = basket.Items[2];
var oldPrice = itemToModify.UnitPrice; var oldPrice = itemToModify.UnitPrice;
var newPrice = oldPrice + priceModification; var newPrice = oldPrice + priceModification;
var pRes = await catalogClient.PostAsync(CatalogScenariosBase.Post.UpdateCatalogProduct, new StringContent(ChangePrice(itemToModify, newPrice, originalCatalogProducts), UTF8Encoding.UTF8, "application/json")); var pRes = await catalogClient.PutAsync(CatalogScenariosBase.Put.UpdateCatalogProduct, new StringContent(ChangePrice(itemToModify, newPrice, originalCatalogProducts), UTF8Encoding.UTF8, "application/json"));
var modifiedCatalogProducts = await GetCatalogAsync(catalogClient); var modifiedCatalogProducts = await GetCatalogAsync(catalogClient);

View File

@ -93,7 +93,7 @@
string BuildOrderWithInvalidExperationTime() string BuildOrderWithInvalidExperationTime()
{ {
var order = new CreateOrderCommand( var order = new CreateOrderCommand(
null, new List<OrderItemDTO>(),
cardExpiration: DateTime.UtcNow.AddYears(-1), cardExpiration: DateTime.UtcNow.AddYears(-1),
cardNumber: "5145-555-5555", cardNumber: "5145-555-5555",
cardHolderName: "Jhon Senna", cardHolderName: "Jhon Senna",

View File

@ -14,6 +14,8 @@ namespace UnitTest.Ordering.Application
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using Xunit; using Xunit;
using static Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands.CreateOrderCommand;
public class NewOrderRequestHandlerTest public class NewOrderRequestHandlerTest
{ {
private readonly Mock<IOrderRepository> _orderRepositoryMock; private readonly Mock<IOrderRepository> _orderRepositoryMock;
@ -72,7 +74,7 @@ namespace UnitTest.Ordering.Application
private CreateOrderCommand FakeOrderRequestWithBuyer(Dictionary<string, object> args = null) private CreateOrderCommand FakeOrderRequestWithBuyer(Dictionary<string, object> args = null)
{ {
return new CreateOrderCommand( return new CreateOrderCommand(
null, new List<OrderItemDTO>(),
city: args != null && args.ContainsKey("city") ? (string)args["city"] : null, city: args != null && args.ContainsKey("city") ? (string)args["city"] : null,
street: args != null && args.ContainsKey("street") ? (string)args["street"] : null, street: args != null && args.ContainsKey("street") ? (string)args["street"] : null,
state: args != null && args.ContainsKey("state") ? (string)args["state"] : null, state: args != null && args.ContainsKey("state") ? (string)args["state"] : null,