BasketService no onger uses UriComposer
- Also fixing corresponding unit tests
This commit is contained in:
@@ -26,7 +26,7 @@ namespace Microsoft.eShopWeb.UnitTests.ApplicationCore.Services.BasketServiceTes
|
||||
basket.AddItem(2, It.IsAny<decimal>(), It.IsAny<int>());
|
||||
_mockBasketRepo.Setup(x => x.GetByIdAsync(It.IsAny<int>()))
|
||||
.ReturnsAsync(basket);
|
||||
var basketService = new BasketService(_mockBasketRepo.Object, null, null, _mockBasketItemRepo.Object);
|
||||
var basketService = new BasketService(_mockBasketRepo.Object, null, _mockBasketItemRepo.Object);
|
||||
|
||||
await basketService.DeleteBasketAsync(It.IsAny<int>());
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Microsoft.eShopWeb.UnitTests.ApplicationCore.Services.BasketServiceTes
|
||||
[Fact]
|
||||
public async void ThrowsGivenInvalidBasketId()
|
||||
{
|
||||
var basketService = new BasketService(_mockBasketRepo.Object, null, null, null);
|
||||
var basketService = new BasketService(_mockBasketRepo.Object, null, null);
|
||||
|
||||
await Assert.ThrowsAsync<BasketNotFoundException>(async () =>
|
||||
await basketService.SetQuantities(_invalidId, new System.Collections.Generic.Dictionary<string, int>()));
|
||||
@@ -30,7 +30,7 @@ namespace Microsoft.eShopWeb.UnitTests.ApplicationCore.Services.BasketServiceTes
|
||||
[Fact]
|
||||
public async void ThrowsGivenNullQuantities()
|
||||
{
|
||||
var basketService = new BasketService(null, null, null, null);
|
||||
var basketService = new BasketService(null, null, null);
|
||||
|
||||
await Assert.ThrowsAsync<ArgumentNullException>(async () =>
|
||||
await basketService.SetQuantities(123, null));
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace Microsoft.eShopWeb.UnitTests.ApplicationCore.Services.BasketServiceTes
|
||||
[Fact]
|
||||
public async void ThrowsGivenNullAnonymousId()
|
||||
{
|
||||
var basketService = new BasketService(null, null, null, null);
|
||||
var basketService = new BasketService(null, null, null);
|
||||
|
||||
await Assert.ThrowsAsync<ArgumentNullException>(async () => await basketService.TransferBasketAsync(null, "steve"));
|
||||
}
|
||||
@@ -17,7 +17,7 @@ namespace Microsoft.eShopWeb.UnitTests.ApplicationCore.Services.BasketServiceTes
|
||||
[Fact]
|
||||
public async void ThrowsGivenNullUserId()
|
||||
{
|
||||
var basketService = new BasketService(null, null, null, null);
|
||||
var basketService = new BasketService(null, null, null);
|
||||
|
||||
await Assert.ThrowsAsync<ArgumentNullException>(async () => await basketService.TransferBasketAsync("abcdefg", null));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user