Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

Fix test

KrzysztofPajak4ea5637f0ca7
diff --git a/src/Tests/Grand.Business.Checkout.Tests/Services/Shipping/ShippingServiceTests.cs b/src/Tests/Grand.Business.Checkout.Tests/Services/Shipping/ShippingServiceTests.cs
index af3a726e0..a50d25b71 100644
--- a/src/Tests/Grand.Business.Checkout.Tests/Services/Shipping/ShippingServiceTests.cs
+++ b/src/Tests/Grand.Business.Checkout.Tests/Services/Shipping/ShippingServiceTests.cs
@@ -19,7 +19,6 @@ namespace Grand.Business.Checkout.Tests.Services.Shipping
[TestClass]
public class ShippingServiceTests
{
- private Mock<IWarehouseService> _warehouseMock;
private Mock<ILogger> _loggerMock;
private Mock<ITranslationService> _translationServiceMock;
private Mock<ICountryService> _countryServiceMokc;
@@ -31,14 +30,13 @@ namespace Grand.Business.Checkout.Tests.Services.Shipping
[TestInitialize]
public void Init()
{
- _warehouseMock = new Mock<IWarehouseService>();
_loggerMock = new Mock<ILogger>();
_translationServiceMock = new Mock<ITranslationService>();
_countryServiceMokc = new Mock<ICountryService>();
_shippingProviderSettings = new ShippingProviderSettings();
_shippingSettings = new ShippingSettings();
_rateProviderMock = new Mock<IShippingRateCalculationProvider>();
- _service = new ShippingService(_warehouseMock.Object, _loggerMock.Object, _translationServiceMock.Object, _countryServiceMokc.Object,
+ _service = new ShippingService(_loggerMock.Object, _translationServiceMock.Object, _countryServiceMokc.Object,
new List<IShippingRateCalculationProvider>() { _rateProviderMock.Object }, _shippingProviderSettings, _shippingSettings);
}
@@ -92,8 +90,7 @@ namespace Grand.Business.Checkout.Tests.Services.Shipping
var warehouse = new Warehouse() {
Address = null
};
- _warehouseMock.Setup(c => c.GetWarehouseById(It.IsAny<string>())).ReturnsAsync(warehouse);
-
+
var result = await _service.CreateShippingOptionRequests(customer, cart, shippingAddress, store);
Assert.AreEqual(result.ShippingAddress, shippingAddress);
@@ -119,7 +116,6 @@ namespace Grand.Business.Checkout.Tests.Services.Shipping
var warehouse = new Warehouse() {
Address = null
};
- _warehouseMock.Setup(c => c.GetWarehouseById(It.IsAny<string>())).ReturnsAsync(warehouse);
var result = await _service.CreateShippingOptionRequests(customer, cart, shippingAddress, store);
Assert.IsTrue(result != null);