diff --git a/Directory.Packages.props b/Directory.Packages.props
index 57c2de096..bed463045 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -6,69 +6,69 @@
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
+
+
-
-
-
-
-
+
+
+
+
+
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
+
-
-
-
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
@@ -76,7 +76,7 @@
-
-
+
+
\ No newline at end of file
diff --git a/src/Plugins/Authentication.Facebook/Authentication.Facebook.csproj b/src/Plugins/Authentication.Facebook/Authentication.Facebook.csproj
index c647c705f..323c3828a 100644
--- a/src/Plugins/Authentication.Facebook/Authentication.Facebook.csproj
+++ b/src/Plugins/Authentication.Facebook/Authentication.Facebook.csproj
@@ -21,7 +21,7 @@
-
+
diff --git a/src/Plugins/Authentication.Google/Authentication.Google.csproj b/src/Plugins/Authentication.Google/Authentication.Google.csproj
index 2bec8067c..881337f8e 100644
--- a/src/Plugins/Authentication.Google/Authentication.Google.csproj
+++ b/src/Plugins/Authentication.Google/Authentication.Google.csproj
@@ -20,7 +20,7 @@
-
+
diff --git a/src/Plugins/Payments.BrainTree/Payments.BrainTree.csproj b/src/Plugins/Payments.BrainTree/Payments.BrainTree.csproj
index 0d76025f7..d6ced0aeb 100644
--- a/src/Plugins/Payments.BrainTree/Payments.BrainTree.csproj
+++ b/src/Plugins/Payments.BrainTree/Payments.BrainTree.csproj
@@ -22,7 +22,7 @@
-
+
diff --git a/src/Plugins/Payments.StripeCheckout/Payments.StripeCheckout.csproj b/src/Plugins/Payments.StripeCheckout/Payments.StripeCheckout.csproj
index 99b7c14ff..d87a41f30 100644
--- a/src/Plugins/Payments.StripeCheckout/Payments.StripeCheckout.csproj
+++ b/src/Plugins/Payments.StripeCheckout/Payments.StripeCheckout.csproj
@@ -21,7 +21,7 @@
-
+
diff --git a/src/Tests/Grand.Business.Authentication.Tests/Services/CookieAuthenticationServiceTests.cs b/src/Tests/Grand.Business.Authentication.Tests/Services/CookieAuthenticationServiceTests.cs
index 4499de723..1654a0d89 100644
--- a/src/Tests/Grand.Business.Authentication.Tests/Services/CookieAuthenticationServiceTests.cs
+++ b/src/Tests/Grand.Business.Authentication.Tests/Services/CookieAuthenticationServiceTests.cs
@@ -66,7 +66,7 @@ public async Task SignOut()
[TestMethod]
public async Task SignIn_NullCustomer_ThrowException()
{
- await Assert.ThrowsExceptionAsync(async () =>
+ await Assert.ThrowsExactlyAsync(async () =>
await _cookieAuthService.SignIn(null, false));
}
diff --git a/src/Tests/Grand.Business.Catalog.Tests/Handlers/UpdateProductReviewTotalsCommandHandlerTest.cs b/src/Tests/Grand.Business.Catalog.Tests/Handlers/UpdateProductReviewTotalsCommandHandlerTest.cs
index 2417973e6..699bbd3d9 100644
--- a/src/Tests/Grand.Business.Catalog.Tests/Handlers/UpdateProductReviewTotalsCommandHandlerTest.cs
+++ b/src/Tests/Grand.Business.Catalog.Tests/Handlers/UpdateProductReviewTotalsCommandHandlerTest.cs
@@ -61,7 +61,7 @@ public async Task InsertProduct_NullArgument_ThrowException()
{
var request = new UpdateProductReviewTotalsCommand();
- await Assert.ThrowsExceptionAsync(
+ await Assert.ThrowsExactlyAsync(
async () => await _updateProductReviewTotalsCommandHandler.Handle(request, default));
}
diff --git a/src/Tests/Grand.Business.Catalog.Tests/Services/Categories/CategoryServiceTests.cs b/src/Tests/Grand.Business.Catalog.Tests/Services/Categories/CategoryServiceTests.cs
index 37d6b27f5..29746808e 100644
--- a/src/Tests/Grand.Business.Catalog.Tests/Services/Categories/CategoryServiceTests.cs
+++ b/src/Tests/Grand.Business.Catalog.Tests/Services/Categories/CategoryServiceTests.cs
@@ -51,7 +51,7 @@ public void Init()
[TestMethod]
public void InsertCategory_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _categoryService.InsertCategory(null),
+ Assert.ThrowsExactlyAsync(async () => await _categoryService.InsertCategory(null),
"category");
}
@@ -68,7 +68,7 @@ public async Task InsertCategory_ValidArgument_InvokeRepositoryAndCache()
[TestMethod]
public void UpdateCategory_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _categoryService.UpdateCategory(null),
+ Assert.ThrowsExactlyAsync(async () => await _categoryService.UpdateCategory(null),
"category");
}
@@ -161,7 +161,7 @@ public async Task DeleteProductCategory_InvokreRepositoryAndClearCache()
[TestMethod]
public void DeleteProductCategory_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(
+ Assert.ThrowsExactlyAsync(
async () => await _productCategoryService.DeleteProductCategory(null, "id"), "productCategory");
}
@@ -180,7 +180,7 @@ public async Task InsertProductCategory_InvokreRepositoryAndClearCache()
[TestMethod]
public void InsertProductCategory_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(
+ Assert.ThrowsExactlyAsync(
async () => await _productCategoryService.InsertProductCategory(null, "id"), "productCategory");
}
diff --git a/src/Tests/Grand.Business.Catalog.Tests/Services/Collections/CollectionServiceTests.cs b/src/Tests/Grand.Business.Catalog.Tests/Services/Collections/CollectionServiceTests.cs
index 23d9da732..f7e2fa6bc 100644
--- a/src/Tests/Grand.Business.Catalog.Tests/Services/Collections/CollectionServiceTests.cs
+++ b/src/Tests/Grand.Business.Catalog.Tests/Services/Collections/CollectionServiceTests.cs
@@ -76,18 +76,18 @@ public async Task GeCollectionById_ValidArgument_GetByCache()
[TestMethod]
public void DeleteCollection_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _collectionService.DeleteCollection(null));
+ Assert.ThrowsExactlyAsync(async () => await _collectionService.DeleteCollection(null));
}
[TestMethod]
public void InsertCollection_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _collectionService.InsertCollection(null));
+ Assert.ThrowsExactlyAsync(async () => await _collectionService.InsertCollection(null));
}
[TestMethod]
public void UpdateCollection_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _collectionService.UpdateCollection(null));
+ Assert.ThrowsExactlyAsync(async () => await _collectionService.UpdateCollection(null));
}
}
\ No newline at end of file
diff --git a/src/Tests/Grand.Business.Catalog.Tests/Services/Directory/SearchTermServiceTests.cs b/src/Tests/Grand.Business.Catalog.Tests/Services/Directory/SearchTermServiceTests.cs
index 60cc265b8..06d11fc21 100644
--- a/src/Tests/Grand.Business.Catalog.Tests/Services/Directory/SearchTermServiceTests.cs
+++ b/src/Tests/Grand.Business.Catalog.Tests/Services/Directory/SearchTermServiceTests.cs
@@ -51,18 +51,18 @@ public async Task DeleteSearchTerm_ValidArgument()
[TestMethod]
public void InsertSearchTerm_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _service.InsertSearchTerm(null));
+ Assert.ThrowsExactlyAsync(async () => await _service.InsertSearchTerm(null));
}
[TestMethod]
public void UpdateSearchTerm_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _service.UpdateSearchTerm(null));
+ Assert.ThrowsExactlyAsync(async () => await _service.UpdateSearchTerm(null));
}
[TestMethod]
public void DeleteSearchTerm_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _service.DeleteSearchTerm(null));
+ Assert.ThrowsExactlyAsync(async () => await _service.DeleteSearchTerm(null));
}
}
\ No newline at end of file
diff --git a/src/Tests/Grand.Business.Checkout.Tests/Commands/Handlers/Orders/CancelOrderCommandHandlerTests.cs b/src/Tests/Grand.Business.Checkout.Tests/Commands/Handlers/Orders/CancelOrderCommandHandlerTests.cs
index 4126236ae..7adfc0cde 100644
--- a/src/Tests/Grand.Business.Checkout.Tests/Commands/Handlers/Orders/CancelOrderCommandHandlerTests.cs
+++ b/src/Tests/Grand.Business.Checkout.Tests/Commands/Handlers/Orders/CancelOrderCommandHandlerTests.cs
@@ -54,7 +54,7 @@ public void Handle_OrderNull_ThrowException()
var command = new CancelOrderCommand {
Order = null
};
- Assert.ThrowsExceptionAsync(async () => await _handler.Handle(command, default));
+ Assert.ThrowsExactlyAsync(async () => await _handler.Handle(command, default));
}
[TestMethod]
@@ -63,7 +63,7 @@ public void Handle_AlreadyCancelled_ThrowException()
var command = new CancelOrderCommand {
Order = new Order { OrderStatusId = (int)OrderStatusSystem.Cancelled }
};
- Assert.ThrowsExceptionAsync(async () => await _handler.Handle(command, default));
+ Assert.ThrowsExactlyAsync(async () => await _handler.Handle(command, default));
}
[TestMethod]
diff --git a/src/Tests/Grand.Business.Checkout.Tests/Extensions/PaymentExtensionsTests.cs b/src/Tests/Grand.Business.Checkout.Tests/Extensions/PaymentExtensionsTests.cs
index 32b31c1d0..a798d5ade 100644
--- a/src/Tests/Grand.Business.Checkout.Tests/Extensions/PaymentExtensionsTests.cs
+++ b/src/Tests/Grand.Business.Checkout.Tests/Extensions/PaymentExtensionsTests.cs
@@ -32,7 +32,7 @@ public void IsPaymentMethodActive_ReturnExpectedResult()
public void IsPaymentMethodActive_NullSettings_ThrowException()
{
PaymentSettings settings = null;
- Assert.ThrowsException(() => _providerMock.Object.IsPaymentMethodActive(settings));
+ Assert.ThrowsExactly(() => _providerMock.Object.IsPaymentMethodActive(settings));
}
[TestMethod]
@@ -40,6 +40,6 @@ public void IsPaymentMethodActive_NullProvider_ThrowException()
{
IPaymentProvider provider = null;
var settings = new PaymentSettings();
- Assert.ThrowsException(() => provider.IsPaymentMethodActive(settings));
+ Assert.ThrowsExactly(() => provider.IsPaymentMethodActive(settings));
}
}
\ No newline at end of file
diff --git a/src/Tests/Grand.Business.Checkout.Tests/Extensions/ShippingExtensionsTests.cs b/src/Tests/Grand.Business.Checkout.Tests/Extensions/ShippingExtensionsTests.cs
index 51aec83d7..e2089f663 100644
--- a/src/Tests/Grand.Business.Checkout.Tests/Extensions/ShippingExtensionsTests.cs
+++ b/src/Tests/Grand.Business.Checkout.Tests/Extensions/ShippingExtensionsTests.cs
@@ -28,7 +28,7 @@ public void IsShippingRateMethodActive_NullProvider_ThrowException()
{
IShippingRateCalculationProvider provider = null;
var settings = new ShippingProviderSettings();
- Assert.ThrowsException(() => provider.IsShippingRateMethodActive(settings));
+ Assert.ThrowsExactly(() => provider.IsShippingRateMethodActive(settings));
}
[TestMethod]
@@ -36,7 +36,7 @@ public void IsShippingRateMethodActive_NullSettings_ThrowException()
{
var providerMock = new Mock();
var provider = providerMock.Object;
- Assert.ThrowsException(() => provider.IsShippingRateMethodActive(null));
+ Assert.ThrowsExactly(() => provider.IsShippingRateMethodActive(null));
}
[TestMethod]
diff --git a/src/Tests/Grand.Business.Checkout.Tests/Services/CheckoutAttributes/CheckoutAttributeServiceTests.cs b/src/Tests/Grand.Business.Checkout.Tests/Services/CheckoutAttributes/CheckoutAttributeServiceTests.cs
index ad4b9a02d..e319f3496 100644
--- a/src/Tests/Grand.Business.Checkout.Tests/Services/CheckoutAttributes/CheckoutAttributeServiceTests.cs
+++ b/src/Tests/Grand.Business.Checkout.Tests/Services/CheckoutAttributes/CheckoutAttributeServiceTests.cs
@@ -44,7 +44,7 @@ public async Task InsertCheckoutAttribute_InvokeExpectedMethods()
[TestMethod]
public void InsertCheckoutAttribute_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _service.InsertCheckoutAttribute(null));
+ Assert.ThrowsExactlyAsync(async () => await _service.InsertCheckoutAttribute(null));
}
[TestMethod]
@@ -59,7 +59,7 @@ public async Task UpdateCheckoutAttribute_InvokeExpectedMethods()
[TestMethod]
public void UpdateCheckoutAttribute_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _service.UpdateCheckoutAttribute(null));
+ Assert.ThrowsExactlyAsync(async () => await _service.UpdateCheckoutAttribute(null));
}
[TestMethod]
@@ -74,6 +74,6 @@ public async Task DeleteCheckoutAttribute_InvokeExpectedMethods()
[TestMethod]
public void DeleteCheckoutAttribute_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _service.DeleteCheckoutAttribute(null));
+ Assert.ThrowsExactlyAsync(async () => await _service.DeleteCheckoutAttribute(null));
}
}
\ No newline at end of file
diff --git a/src/Tests/Grand.Business.Checkout.Tests/Services/GiftVouchers/GiftVoucherServiceTests.cs b/src/Tests/Grand.Business.Checkout.Tests/Services/GiftVouchers/GiftVoucherServiceTests.cs
index 4e263a50b..55b89fff7 100644
--- a/src/Tests/Grand.Business.Checkout.Tests/Services/GiftVouchers/GiftVoucherServiceTests.cs
+++ b/src/Tests/Grand.Business.Checkout.Tests/Services/GiftVouchers/GiftVoucherServiceTests.cs
@@ -50,7 +50,7 @@ public async Task InsertGiftVoucher_InovokeExpectedMethods()
[TestMethod]
public void InsertGiftVoucher_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _service.InsertGiftVoucher(null));
+ Assert.ThrowsExactlyAsync(async () => await _service.InsertGiftVoucher(null));
}
[TestMethod]
@@ -64,7 +64,7 @@ public async Task UpdateGiftVoucher_InovokeExpectedMethods()
[TestMethod]
public void UpdateGiftVoucher_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _service.UpdateGiftVoucher(null));
+ Assert.ThrowsExactlyAsync(async () => await _service.UpdateGiftVoucher(null));
}
[TestMethod]
@@ -78,6 +78,6 @@ public async Task DeleteGiftVoucher_InovokeExpectedMethods()
[TestMethod]
public void DeleteGiftVoucher_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _service.DeleteGiftVoucher(null));
+ Assert.ThrowsExactlyAsync(async () => await _service.DeleteGiftVoucher(null));
}
}
\ No newline at end of file
diff --git a/src/Tests/Grand.Business.Checkout.Tests/Services/Orders/OrderServiceTests.cs b/src/Tests/Grand.Business.Checkout.Tests/Services/Orders/OrderServiceTests.cs
index c522c3fac..6069d45aa 100644
--- a/src/Tests/Grand.Business.Checkout.Tests/Services/Orders/OrderServiceTests.cs
+++ b/src/Tests/Grand.Business.Checkout.Tests/Services/Orders/OrderServiceTests.cs
@@ -36,7 +36,7 @@ public async Task UpdateOrder_InvokeExpectedMethods()
[TestMethod]
public void UpdateOrder_NullArguments_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _service.UpdateOrder(null));
+ Assert.ThrowsExactlyAsync(async () => await _service.UpdateOrder(null));
}
[TestMethod]
@@ -50,7 +50,7 @@ public async Task InsertOrderNote_InvokeExpectedMethods()
[TestMethod]
public void InsertOrderNote_NullArguments_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _service.InsertOrderNote(null));
+ Assert.ThrowsExactlyAsync(async () => await _service.InsertOrderNote(null));
}
[TestMethod]
@@ -64,6 +64,6 @@ public async Task DeleteOrderNote_InvokeExpectedMethods()
[TestMethod]
public void DeleteOrderNote_NullArguments_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _service.DeleteOrderNote(null));
+ Assert.ThrowsExactlyAsync(async () => await _service.DeleteOrderNote(null));
}
}
\ No newline at end of file
diff --git a/src/Tests/Grand.Business.Checkout.Tests/Services/Orders/OrderStatusServiceTests.cs b/src/Tests/Grand.Business.Checkout.Tests/Services/Orders/OrderStatusServiceTests.cs
index 226b88b34..cc838c23e 100644
--- a/src/Tests/Grand.Business.Checkout.Tests/Services/Orders/OrderStatusServiceTests.cs
+++ b/src/Tests/Grand.Business.Checkout.Tests/Services/Orders/OrderStatusServiceTests.cs
@@ -38,7 +38,7 @@ public async Task Insert_InvokeExpectedMethods()
[TestMethod]
public void Insert_NullArguemnt_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _service.Insert(null));
+ Assert.ThrowsExactlyAsync(async () => await _service.Insert(null));
}
[TestMethod]
@@ -53,7 +53,7 @@ public async Task Update_InvokeExpectedMethods()
[TestMethod]
public void Update_NullArguemnt_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _service.Update(null));
+ Assert.ThrowsExactlyAsync(async () => await _service.Update(null));
}
[TestMethod]
@@ -68,6 +68,6 @@ public async Task Delete_InvokeExpectedMethods()
[TestMethod]
public void Delete_NullArguemnt_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _service.Delete(null));
+ Assert.ThrowsExactlyAsync(async () => await _service.Delete(null));
}
}
\ No newline at end of file
diff --git a/src/Tests/Grand.Business.Checkout.Tests/Services/Payments/PaymentServiceTests.cs b/src/Tests/Grand.Business.Checkout.Tests/Services/Payments/PaymentServiceTests.cs
index bd8776036..4143dfad9 100644
--- a/src/Tests/Grand.Business.Checkout.Tests/Services/Payments/PaymentServiceTests.cs
+++ b/src/Tests/Grand.Business.Checkout.Tests/Services/Payments/PaymentServiceTests.cs
@@ -107,7 +107,7 @@ public void ProcessPayment_NotFoundPaymentMethod_ThrowException()
{
_paymentProviderMock.Setup(c => c.SystemName).Returns("systemName2");
var request = new PaymentTransaction { PaymentMethodSystemName = "systemName", TransactionAmount = 500 };
- Assert.ThrowsExceptionAsync(async () => await _paymentService.ProcessPayment(request));
+ Assert.ThrowsExactlyAsync(async () => await _paymentService.ProcessPayment(request));
}
[TestMethod]
@@ -130,7 +130,7 @@ public void PostProcessPayment_NotFoundPaymentMethod_ThrowException()
PaymentMethodSystemName = "systemName2", TransactionAmount = 500,
TransactionStatus = TransactionStatus.Authorized
};
- Assert.ThrowsExceptionAsync(async () => await _paymentService.PostProcessPayment(request),
+ Assert.ThrowsExactlyAsync(async () => await _paymentService.PostProcessPayment(request),
"Payment method couldn't be loaded");
}
diff --git a/src/Tests/Grand.Business.Checkout.Tests/Services/Payments/PaymentTransactionServiceTests.cs b/src/Tests/Grand.Business.Checkout.Tests/Services/Payments/PaymentTransactionServiceTests.cs
index 85f9d897a..173a1ab16 100644
--- a/src/Tests/Grand.Business.Checkout.Tests/Services/Payments/PaymentTransactionServiceTests.cs
+++ b/src/Tests/Grand.Business.Checkout.Tests/Services/Payments/PaymentTransactionServiceTests.cs
@@ -34,7 +34,7 @@ public async Task InsertPaymentTransaction_InvokeExpectedMethods()
[TestMethod]
public void InsertPaymentTransaction_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _service.InsertPaymentTransaction(null));
+ Assert.ThrowsExactlyAsync(async () => await _service.InsertPaymentTransaction(null));
}
[TestMethod]
@@ -48,7 +48,7 @@ public async Task UpdatePaymentTransaction_InvokeExpectedMethods()
[TestMethod]
public void UpdatePaymentTransaction_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _service.UpdatePaymentTransaction(null));
+ Assert.ThrowsExactlyAsync(async () => await _service.UpdatePaymentTransaction(null));
}
[TestMethod]
@@ -62,6 +62,6 @@ public async Task DeletePaymentTransaction_InvokeExpectedMethods()
[TestMethod]
public void DeletePaymentTransaction_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _service.DeletePaymentTransaction(null));
+ Assert.ThrowsExactlyAsync(async () => await _service.DeletePaymentTransaction(null));
}
}
\ No newline at end of file
diff --git a/src/Tests/Grand.Business.Checkout.Tests/Services/Shipping/DeliveryDateServiceTests.cs b/src/Tests/Grand.Business.Checkout.Tests/Services/Shipping/DeliveryDateServiceTests.cs
index 34908a496..2595c5a31 100644
--- a/src/Tests/Grand.Business.Checkout.Tests/Services/Shipping/DeliveryDateServiceTests.cs
+++ b/src/Tests/Grand.Business.Checkout.Tests/Services/Shipping/DeliveryDateServiceTests.cs
@@ -38,7 +38,7 @@ public async Task InsertDeliveryDate_InvokeExpectedMethods()
[TestMethod]
public void InsertDeliveryDate_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _service.InsertDeliveryDate(null));
+ Assert.ThrowsExactlyAsync(async () => await _service.InsertDeliveryDate(null));
}
[TestMethod]
@@ -53,7 +53,7 @@ public async Task UpdateDeliveryDate_InvokeExpectedMethods()
[TestMethod]
public void UpdateDeliveryDate_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _service.UpdateDeliveryDate(null));
+ Assert.ThrowsExactlyAsync(async () => await _service.UpdateDeliveryDate(null));
}
[TestMethod]
@@ -68,6 +68,6 @@ public async Task DeleteDeliveryDate_InvokeExpectedMethods()
[TestMethod]
public void DeleteDeliveryDate_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _service.DeleteDeliveryDate(null));
+ Assert.ThrowsExactlyAsync(async () => await _service.DeleteDeliveryDate(null));
}
}
\ No newline at end of file
diff --git a/src/Tests/Grand.Business.Checkout.Tests/Services/Shipping/PickupPointServiceTests.cs b/src/Tests/Grand.Business.Checkout.Tests/Services/Shipping/PickupPointServiceTests.cs
index 54a568364..f819102eb 100644
--- a/src/Tests/Grand.Business.Checkout.Tests/Services/Shipping/PickupPointServiceTests.cs
+++ b/src/Tests/Grand.Business.Checkout.Tests/Services/Shipping/PickupPointServiceTests.cs
@@ -39,7 +39,7 @@ public async Task InsertPickupPoint_InvokeExpectedMethods()
[TestMethod]
public void InsertPickupPoint_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _service.InsertPickupPoint(null));
+ Assert.ThrowsExactlyAsync(async () => await _service.InsertPickupPoint(null));
}
[TestMethod]
@@ -54,7 +54,7 @@ public async Task UpdatePickupPoint_InvokeExpectedMethods()
[TestMethod]
public void UpdatePickupPoint_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _service.UpdatePickupPoint(null));
+ Assert.ThrowsExactlyAsync(async () => await _service.UpdatePickupPoint(null));
}
[TestMethod]
@@ -69,6 +69,6 @@ public async Task DeletePickupPoint_InvokeExpectedMethods()
[TestMethod]
public void DeletePickupPoint_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _service.DeletePickupPoint(null));
+ Assert.ThrowsExactlyAsync(async () => await _service.DeletePickupPoint(null));
}
}
\ No newline at end of file
diff --git a/src/Tests/Grand.Business.Checkout.Tests/Services/Shipping/ShippingMethodServiceTests.cs b/src/Tests/Grand.Business.Checkout.Tests/Services/Shipping/ShippingMethodServiceTests.cs
index d9e8abd9e..5e1695f33 100644
--- a/src/Tests/Grand.Business.Checkout.Tests/Services/Shipping/ShippingMethodServiceTests.cs
+++ b/src/Tests/Grand.Business.Checkout.Tests/Services/Shipping/ShippingMethodServiceTests.cs
@@ -39,7 +39,7 @@ public async Task InsertShippingMethod_InvokeExpectedMethods()
[TestMethod]
public void InsertShippingMethod_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _service.InsertShippingMethod(null));
+ Assert.ThrowsExactlyAsync(async () => await _service.InsertShippingMethod(null));
}
[TestMethod]
@@ -54,7 +54,7 @@ public async Task UpdateShippingMethod_InvokeExpectedMethods()
[TestMethod]
public void UpdateShippingMethod_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _service.UpdateShippingMethod(null));
+ Assert.ThrowsExactlyAsync(async () => await _service.UpdateShippingMethod(null));
}
[TestMethod]
@@ -69,6 +69,6 @@ public async Task DeleteShippingMethod_InvokeExpectedMethods()
[TestMethod]
public void DeleteShippingMethod_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _service.DeleteShippingMethod(null));
+ Assert.ThrowsExactlyAsync(async () => await _service.DeleteShippingMethod(null));
}
}
\ No newline at end of file
diff --git a/src/Tests/Grand.Business.Checkout.Tests/Services/Shipping/WarehouseServiceTests.cs b/src/Tests/Grand.Business.Checkout.Tests/Services/Shipping/WarehouseServiceTests.cs
index 2e3f68d15..22027f47f 100644
--- a/src/Tests/Grand.Business.Checkout.Tests/Services/Shipping/WarehouseServiceTests.cs
+++ b/src/Tests/Grand.Business.Checkout.Tests/Services/Shipping/WarehouseServiceTests.cs
@@ -40,7 +40,7 @@ public async Task InsertWarehouse_InvokeExpectedMethods()
[TestMethod]
public void InsertWarehouse_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _service.InsertWarehouse(null));
+ Assert.ThrowsExactlyAsync(async () => await _service.InsertWarehouse(null));
}
[TestMethod]
@@ -55,7 +55,7 @@ public async Task UpdateWarehouse_InvokeExpectedMethods()
[TestMethod]
public void UpdateWarehouse_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _service.UpdateWarehouse(null));
+ Assert.ThrowsExactlyAsync(async () => await _service.UpdateWarehouse(null));
}
[TestMethod]
@@ -70,6 +70,6 @@ public async Task DeleteWarehouse_InvokeExpectedMethods()
[TestMethod]
public void DeleteWarehouse_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _service.DeleteWarehouse(null));
+ Assert.ThrowsExactlyAsync(async () => await _service.DeleteWarehouse(null));
}
}
\ No newline at end of file
diff --git a/src/Tests/Grand.Business.Cms.Tests/Services/BlogServiceTests.cs b/src/Tests/Grand.Business.Cms.Tests/Services/BlogServiceTests.cs
index f6581afe6..1ef3cc8bb 100644
--- a/src/Tests/Grand.Business.Cms.Tests/Services/BlogServiceTests.cs
+++ b/src/Tests/Grand.Business.Cms.Tests/Services/BlogServiceTests.cs
@@ -38,7 +38,7 @@ public void Init()
[TestMethod]
public void DeleteBlogPost_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _blogService.DeleteBlogPost(null),
+ Assert.ThrowsExactlyAsync(async () => await _blogService.DeleteBlogPost(null),
"blogPost");
}
@@ -60,7 +60,7 @@ public async Task GetBlogPostById()
[TestMethod]
public void InsertBlogPost_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _blogService.InsertBlogPost(null),
+ Assert.ThrowsExactlyAsync(async () => await _blogService.InsertBlogPost(null),
"blogPost");
}
@@ -83,7 +83,7 @@ public async Task UpdateBlogPost_ValiArgument_InvokeRepository()
[TestMethod]
public void UpdateBlogPost_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _blogService.UpdateBlogPost(null),
+ Assert.ThrowsExactlyAsync(async () => await _blogService.UpdateBlogPost(null),
"blogPost");
}
@@ -98,7 +98,7 @@ public async Task InsertBlogProduct_ValiArgument__InvokeRepository()
[TestMethod]
public void InsertBlogProductInsertBlogProduct_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _blogService.InsertBlogProduct(null),
+ Assert.ThrowsExactlyAsync(async () => await _blogService.InsertBlogProduct(null),
"blogProduct");
}
@@ -113,7 +113,7 @@ public async Task UpdateBlogProduct_ValiArgument_InvokeRepository()
[TestMethod]
public void UpdateBlogProduct_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _blogService.UpdateBlogProduct(null),
+ Assert.ThrowsExactlyAsync(async () => await _blogService.UpdateBlogProduct(null),
"blogProduct");
}
@@ -128,7 +128,7 @@ public async Task DeleteBlogProduct_ValidArgument_InvokeRepository()
[TestMethod]
public void DeleteBlogProduct_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _blogService.DeleteBlogProduct(null),
+ Assert.ThrowsExactlyAsync(async () => await _blogService.DeleteBlogProduct(null),
"blogProduct");
}
@@ -143,7 +143,7 @@ public async Task InsertBlogCategory_ValiArgument__InvokeRepository()
[TestMethod]
public void InsertBlogCategory_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _blogService.InsertBlogCategory(null),
+ Assert.ThrowsExactlyAsync(async () => await _blogService.InsertBlogCategory(null),
"blogCategory");
}
@@ -158,7 +158,7 @@ public async Task UpdateBlogCategory_ValiArgument_InvokeRepository()
[TestMethod]
public void UpdateBlogCategory_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _blogService.UpdateBlogCategory(null),
+ Assert.ThrowsExactlyAsync(async () => await _blogService.UpdateBlogCategory(null),
"blogCategory");
}
@@ -173,7 +173,7 @@ public async Task DeleteBlogCategory_ValidArgument_InvokeRepository()
[TestMethod]
public void DeleteBlogCategory_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _blogService.DeleteBlogCategory(null),
+ Assert.ThrowsExactlyAsync(async () => await _blogService.DeleteBlogCategory(null),
"blogCategory");
}
diff --git a/src/Tests/Grand.Business.Common.Tests/Extensions/TranslateExtensionsTests.cs b/src/Tests/Grand.Business.Common.Tests/Extensions/TranslateExtensionsTests.cs
index cac29631f..e9e60cb41 100644
--- a/src/Tests/Grand.Business.Common.Tests/Extensions/TranslateExtensionsTests.cs
+++ b/src/Tests/Grand.Business.Common.Tests/Extensions/TranslateExtensionsTests.cs
@@ -30,14 +30,14 @@ public void GetTranslation_ReturnExpectedValue()
public void GetTranslation_NullArgument_ThrowException()
{
Product product = null;
- Assert.ThrowsException(() => product.GetTranslation(c => c.Name, "PL"));
+ Assert.ThrowsExactly(() => product.GetTranslation(c => c.Name, "PL"));
}
[TestMethod]
public void GetTranslation_ExpressionUseMethod_ThrowException()
{
var product = new Product();
- Assert.ThrowsException(() =>
+ Assert.ThrowsExactly(() =>
product.GetTranslation(c => c.ParseRequiredProductIds().First(), "PL"));
}
@@ -60,7 +60,7 @@ public void GetTranslationEnum_UseNotEnum_ThrowException()
{
var translationServiceMock = new Mock();
var fake = new FakeStruct();
- Assert.ThrowsException(() => fake.GetTranslationEnum(translationServiceMock.Object, "PL"));
+ Assert.ThrowsExactly(() => fake.GetTranslationEnum(translationServiceMock.Object, "PL"));
}
private struct FakeStruct;
diff --git a/src/Tests/Grand.Business.Common.Tests/Services/Configuration/SettingServiceTests.cs b/src/Tests/Grand.Business.Common.Tests/Services/Configuration/SettingServiceTests.cs
index 674bf0571..18499df3c 100644
--- a/src/Tests/Grand.Business.Common.Tests/Services/Configuration/SettingServiceTests.cs
+++ b/src/Tests/Grand.Business.Common.Tests/Services/Configuration/SettingServiceTests.cs
@@ -33,7 +33,7 @@ public async Task InsertSetting_InvokeExpectedMethods()
[TestMethod]
public void InsertSetting_NullArgument_TrhowException()
{
- Assert.ThrowsExceptionAsync(async () => await _service.InsertSetting(null));
+ Assert.ThrowsExactlyAsync(async () => await _service.InsertSetting(null));
}
[TestMethod]
@@ -47,7 +47,7 @@ public async Task UpdateSetting_InvokeExpectedMethods()
[TestMethod]
public void UpdateSetting_NullArgument_TrhowException()
{
- Assert.ThrowsExceptionAsync(async () => await _service.UpdateSetting(null));
+ Assert.ThrowsExactlyAsync(async () => await _service.UpdateSetting(null));
}
[TestMethod]
@@ -61,6 +61,6 @@ public async Task DeleteSetting_InvokeExpectedMethods()
[TestMethod]
public void DeleteSetting_NullArgument_TrhowException()
{
- Assert.ThrowsExceptionAsync(async () => await _service.DeleteSetting(null));
+ Assert.ThrowsExactlyAsync(async () => await _service.DeleteSetting(null));
}
}
\ No newline at end of file
diff --git a/src/Tests/Grand.Business.Common.Tests/Services/Directory/CurrencyServiceTests.cs b/src/Tests/Grand.Business.Common.Tests/Services/Directory/CurrencyServiceTests.cs
index 52da1c874..a9e5a3deb 100644
--- a/src/Tests/Grand.Business.Common.Tests/Services/Directory/CurrencyServiceTests.cs
+++ b/src/Tests/Grand.Business.Common.Tests/Services/Directory/CurrencyServiceTests.cs
@@ -144,7 +144,7 @@ public void ConvertToPrimaryExchangeRateCurrency_ZeroExchangeRate_ThrowException
_cacheManager.Setup(c => c.GetAsync(It.IsAny(), It.IsAny>>()))
.Returns(Task.FromResult(currencyUSD));
currencyEUR.Rate = 0;
- Assert.ThrowsExceptionAsync(async () =>
+ Assert.ThrowsExactlyAsync(async () =>
await _currencyService.ConvertToPrimaryExchangeRateCurrency(100, currencyEUR));
}
@@ -153,7 +153,7 @@ public void ConvertToPrimaryExchangeRateCurrency_CannotLoadPrimaryExchange_Throw
{
_cacheManager.Setup(c => c.GetAsync(It.IsAny(), It.IsAny>>()))
.Returns(Task.FromResult(null));
- Assert.ThrowsExceptionAsync(async () =>
+ Assert.ThrowsExactlyAsync(async () =>
await _currencyService.ConvertToPrimaryExchangeRateCurrency(100, currencyEUR));
}
diff --git a/src/Tests/Grand.Business.Common.Tests/Services/Directory/HistoryServiceTests.cs b/src/Tests/Grand.Business.Common.Tests/Services/Directory/HistoryServiceTests.cs
index e3fa5197d..f3fa8efdc 100644
--- a/src/Tests/Grand.Business.Common.Tests/Services/Directory/HistoryServiceTests.cs
+++ b/src/Tests/Grand.Business.Common.Tests/Services/Directory/HistoryServiceTests.cs
@@ -24,7 +24,7 @@ public void Init()
[TestMethod]
public void SaveObject_NullObject_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _historyService.SaveObject(null),
+ Assert.ThrowsExactlyAsync(async () => await _historyService.SaveObject(null),
"entity");
}
diff --git a/src/Tests/Grand.Business.Common.Tests/Services/Security/EncryptionServiceTests.cs b/src/Tests/Grand.Business.Common.Tests/Services/Security/EncryptionServiceTests.cs
index 492fec7ba..05cad3772 100644
--- a/src/Tests/Grand.Business.Common.Tests/Services/Security/EncryptionServiceTests.cs
+++ b/src/Tests/Grand.Business.Common.Tests/Services/Security/EncryptionServiceTests.cs
@@ -73,7 +73,7 @@ public void EncryptText_InvalidPrivateKeyLength_ThrowException()
{
var privateKey = "secure key.";
var toEncrypte = "text to encrypte...";
- Assert.ThrowsException(() => _encryptionService.EncryptText(toEncrypte, privateKey));
+ Assert.ThrowsExactly(() => _encryptionService.EncryptText(toEncrypte, privateKey));
}
[TestMethod]
@@ -91,6 +91,6 @@ public void DecryptText_InvalidPrivateKeyLength_ThrowException()
{
var privateKey = "secure key.";
var toDescrypt = "gdfgdfgt45gfdfg";
- Assert.ThrowsException(() => _encryptionService.DecryptText(toDescrypt, privateKey));
+ Assert.ThrowsExactly(() => _encryptionService.DecryptText(toDescrypt, privateKey));
}
}
\ No newline at end of file
diff --git a/src/Tests/Grand.Business.Common.Tests/Services/Stores/StoreServiceTests.cs b/src/Tests/Grand.Business.Common.Tests/Services/Stores/StoreServiceTests.cs
index d3c34c83c..aeb3d2668 100644
--- a/src/Tests/Grand.Business.Common.Tests/Services/Stores/StoreServiceTests.cs
+++ b/src/Tests/Grand.Business.Common.Tests/Services/Stores/StoreServiceTests.cs
@@ -61,7 +61,7 @@ public void DeleteStore_OnlyOneStore_ThrowException()
//can not remove store if it is only one
_cacheMock.Setup(c => c.GetAsync(It.IsAny(), It.IsAny>>>()))
.Returns(Task.FromResult(new List { new() }));
- Assert.ThrowsExceptionAsync(async () => await _service.DeleteStore(new Store()));
+ Assert.ThrowsExactlyAsync(async () => await _service.DeleteStore(new Store()));
}
[TestMethod]
diff --git a/src/Tests/Grand.Business.Customers.Tests/Extensions/AffiliateExtensionsTests.cs b/src/Tests/Grand.Business.Customers.Tests/Extensions/AffiliateExtensionsTests.cs
index 8b668f18c..f5fea1b53 100644
--- a/src/Tests/Grand.Business.Customers.Tests/Extensions/AffiliateExtensionsTests.cs
+++ b/src/Tests/Grand.Business.Customers.Tests/Extensions/AffiliateExtensionsTests.cs
@@ -31,7 +31,7 @@ public void TestInitialize()
public void GetFullName_NullParameter_ThrowException()
{
Affiliate affiliate = null;
- Assert.ThrowsException(() => affiliate.GetFullName());
+ Assert.ThrowsExactly(() => affiliate.GetFullName());
}
[TestMethod]
@@ -68,14 +68,14 @@ public void GetFullName_ValidParameter_ReturnLastName()
public void GenerateUrl_NullAffiliate_ThrowException()
{
Affiliate affiliate = null;
- Assert.ThrowsException(() => affiliate.GenerateUrl(null), "affiliate");
+ Assert.ThrowsExactly(() => affiliate.GenerateUrl(null), "affiliate");
}
[TestMethod]
public void GenerateUrl_NullWebHelper_ThrowException()
{
var affiliate = new Affiliate();
- Assert.ThrowsException(() => affiliate.GenerateUrl(null), "webHelper");
+ Assert.ThrowsExactly(() => affiliate.GenerateUrl(null), "webHelper");
}
[TestMethod]
diff --git a/src/Tests/Grand.Business.Customers.Tests/Services/AffiliateServiceTests.cs b/src/Tests/Grand.Business.Customers.Tests/Services/AffiliateServiceTests.cs
index f5a42e167..630afd8a5 100644
--- a/src/Tests/Grand.Business.Customers.Tests/Services/AffiliateServiceTests.cs
+++ b/src/Tests/Grand.Business.Customers.Tests/Services/AffiliateServiceTests.cs
@@ -38,21 +38,21 @@ public async Task GetAffiliateByIdTest()
[TestMethod]
public async Task UpdateAffiliate_NullParameter_ThrwoException()
{
- await Assert.ThrowsExceptionAsync(
+ await Assert.ThrowsExactlyAsync(
async () => await _affiliateService.UpdateAffiliate(null), "affiliate");
}
[TestMethod]
public async Task InsertAffiliate_NullParameter_ThrwoException()
{
- await Assert.ThrowsExceptionAsync(
+ await Assert.ThrowsExactlyAsync(
async () => await _affiliateService.InsertAffiliate(null), "affiliate");
}
[TestMethod]
public async Task DeleteAffiliate_NullParameter_ThrwoException()
{
- await Assert.ThrowsExceptionAsync(
+ await Assert.ThrowsExactlyAsync(
async () => await _affiliateService.DeleteAffiliate(null), "affiliate");
}
diff --git a/src/Tests/Grand.Business.Marketing.Tests/Services/Courses/CourseActionServiceTests.cs b/src/Tests/Grand.Business.Marketing.Tests/Services/Courses/CourseActionServiceTests.cs
index 2c93820de..20bfd34ee 100644
--- a/src/Tests/Grand.Business.Marketing.Tests/Services/Courses/CourseActionServiceTests.cs
+++ b/src/Tests/Grand.Business.Marketing.Tests/Services/Courses/CourseActionServiceTests.cs
@@ -26,7 +26,7 @@ public void Init()
[TestMethod]
public void InsertAsync_NullArgument_ThrowExcepiton()
{
- Assert.ThrowsExceptionAsync(async () => await _courseActionService.InsertAsync(null),
+ Assert.ThrowsExactlyAsync(async () => await _courseActionService.InsertAsync(null),
"courseAction");
}
@@ -41,7 +41,7 @@ public async Task InsertAsync_NullArgument_InvokeRepository()
[TestMethod]
public void Update_NullArgument_ThrowExcepiton()
{
- Assert.ThrowsExceptionAsync(async () => await _courseActionService.Update(null),
+ Assert.ThrowsExactlyAsync(async () => await _courseActionService.Update(null),
"courseAction");
}
diff --git a/src/Tests/Grand.Business.Marketing.Tests/Services/Courses/CoursesServiceTests.cs b/src/Tests/Grand.Business.Marketing.Tests/Services/Courses/CoursesServiceTests.cs
index 6cdfff14f..73fc30b5b 100644
--- a/src/Tests/Grand.Business.Marketing.Tests/Services/Courses/CoursesServiceTests.cs
+++ b/src/Tests/Grand.Business.Marketing.Tests/Services/Courses/CoursesServiceTests.cs
@@ -35,7 +35,7 @@ public void Init()
[TestMethod]
public void Delete_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _courseService.Delete(null), "course");
+ Assert.ThrowsExactlyAsync(async () => await _courseService.Delete(null), "course");
}
[TestMethod]
@@ -49,7 +49,7 @@ public async Task Delete_ValidArgument_InvokeRepository()
[TestMethod]
public void Insert_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _courseService.Insert(null), "course");
+ Assert.ThrowsExactlyAsync(async () => await _courseService.Insert(null), "course");
}
[TestMethod]
@@ -63,7 +63,7 @@ public async Task Insert_ValidArgument_InvokeRepository()
[TestMethod]
public void Update_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _courseService.Update(null), "course");
+ Assert.ThrowsExactlyAsync(async () => await _courseService.Update(null), "course");
}
[TestMethod]
diff --git a/src/Tests/Grand.Business.Marketing.Tests/Services/Documents/DocumentServiceTests.cs b/src/Tests/Grand.Business.Marketing.Tests/Services/Documents/DocumentServiceTests.cs
index 509448a20..985995ed0 100644
--- a/src/Tests/Grand.Business.Marketing.Tests/Services/Documents/DocumentServiceTests.cs
+++ b/src/Tests/Grand.Business.Marketing.Tests/Services/Documents/DocumentServiceTests.cs
@@ -26,7 +26,7 @@ public void Init()
[TestMethod]
public async Task DeleteDocument_NullArgument_ThrowException()
{
- await Assert.ThrowsExceptionAsync(async () => await _documentService.Delete(null),
+ await Assert.ThrowsExactlyAsync(async () => await _documentService.Delete(null),
"document");
}
@@ -48,7 +48,7 @@ public async Task GetDocumentById()
[TestMethod]
public async Task InsertDocument_NullArgument_ThrowException()
{
- await Assert.ThrowsExceptionAsync(async () => await _documentService.Insert(null),
+ await Assert.ThrowsExactlyAsync(async () => await _documentService.Insert(null),
"document");
}
@@ -71,6 +71,6 @@ public async Task UpdateDocument_ValidArgument()
[TestMethod]
public void UpdateDocument_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _documentService.Update(null), "document");
+ Assert.ThrowsExactlyAsync(async () => await _documentService.Update(null), "document");
}
}
\ No newline at end of file
diff --git a/src/Tests/Grand.Business.Marketing.Tests/Services/Documents/DocumentTypeServiceTests.cs b/src/Tests/Grand.Business.Marketing.Tests/Services/Documents/DocumentTypeServiceTests.cs
index e3363c34c..9cde1c476 100644
--- a/src/Tests/Grand.Business.Marketing.Tests/Services/Documents/DocumentTypeServiceTests.cs
+++ b/src/Tests/Grand.Business.Marketing.Tests/Services/Documents/DocumentTypeServiceTests.cs
@@ -45,7 +45,7 @@ public void Init()
[TestMethod]
public async Task DeleteDocumentType_NullArgument_ThrowException()
{
- await Assert.ThrowsExceptionAsync(async () => await _documentTypeService.Delete(null),
+ await Assert.ThrowsExactlyAsync(async () => await _documentTypeService.Delete(null),
"documentType");
}
@@ -67,7 +67,7 @@ public async Task GetDocumentTypeById()
[TestMethod]
public async Task InsertDocumentType_NullArgument_ThrowException()
{
- await Assert.ThrowsExceptionAsync(async () => await _documentTypeService.Insert(null),
+ await Assert.ThrowsExactlyAsync(async () => await _documentTypeService.Insert(null),
"documentType");
}
@@ -90,7 +90,7 @@ public async Task UpdateDocumentType_ValidArgument()
[TestMethod]
public void UpdateDocumentType_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _documentTypeService.Update(null),
+ Assert.ThrowsExactlyAsync(async () => await _documentTypeService.Update(null),
"documentType");
}
}
\ No newline at end of file
diff --git a/src/Tests/Grand.Business.Marketing.Tests/Services/Newsletters/NewsLetterSubscriptionServiceTests.cs b/src/Tests/Grand.Business.Marketing.Tests/Services/Newsletters/NewsLetterSubscriptionServiceTests.cs
index bfa433e5a..03f65314a 100644
--- a/src/Tests/Grand.Business.Marketing.Tests/Services/Newsletters/NewsLetterSubscriptionServiceTests.cs
+++ b/src/Tests/Grand.Business.Marketing.Tests/Services/Newsletters/NewsLetterSubscriptionServiceTests.cs
@@ -39,7 +39,7 @@ public void InsertNewsLetterSubscription_InvalidEmail_ThrowException()
var newsLetterSubscription = new NewsLetterSubscription {
Email = email
};
- Assert.ThrowsExceptionAsync(async () =>
+ Assert.ThrowsExactlyAsync(async () =>
await _newsLetterSubscriptionService.InsertNewsLetterSubscription(newsLetterSubscription));
}
diff --git a/src/Tests/Grand.Business.Marketing.Tests/Services/Newsletters/NewsletterCategoryServiceTests.cs b/src/Tests/Grand.Business.Marketing.Tests/Services/Newsletters/NewsletterCategoryServiceTests.cs
index 1ecdf6514..82bc575a2 100644
--- a/src/Tests/Grand.Business.Marketing.Tests/Services/Newsletters/NewsletterCategoryServiceTests.cs
+++ b/src/Tests/Grand.Business.Marketing.Tests/Services/Newsletters/NewsletterCategoryServiceTests.cs
@@ -26,7 +26,7 @@ public void Init()
[TestMethod]
public async Task DeleteNewsletterCategory_NullArgument_ThrowException()
{
- await Assert.ThrowsExceptionAsync(
+ await Assert.ThrowsExactlyAsync(
async () => await _newsletterCategoryService.DeleteNewsletterCategory(null), "newslettercategory");
}
@@ -48,7 +48,7 @@ public async Task GetDocumentById()
[TestMethod]
public async Task InsertNewsletterCategory_NullArgument_ThrowException()
{
- await Assert.ThrowsExceptionAsync(
+ await Assert.ThrowsExactlyAsync(
async () => await _newsletterCategoryService.InsertNewsletterCategory(null), "newslettercategory");
}
@@ -71,7 +71,7 @@ public async Task UpdateNewsletterCategory_ValidArgument()
[TestMethod]
public void UpdateNewsletterCategory_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(
+ Assert.ThrowsExactlyAsync(
async () => await _newsletterCategoryService.UpdateNewsletterCategory(null), "newslettercategory");
}
}
\ No newline at end of file
diff --git a/src/Tests/Grand.Business.Messages.Tests/Services/EmailAccountServiceTests.cs b/src/Tests/Grand.Business.Messages.Tests/Services/EmailAccountServiceTests.cs
index e18867652..655b0bb17 100644
--- a/src/Tests/Grand.Business.Messages.Tests/Services/EmailAccountServiceTests.cs
+++ b/src/Tests/Grand.Business.Messages.Tests/Services/EmailAccountServiceTests.cs
@@ -62,6 +62,6 @@ public void DeleteEmailAccount_ExistOnlyOneAccount_ThrowException()
//we can't delete account if exist only one
_cacheMock.Setup(c => c.GetAsync(It.IsAny(), It.IsAny>>>()))
.Returns(Task.FromResult(new List { new() }));
- Assert.ThrowsExceptionAsync(async () => await _service.DeleteEmailAccount(new EmailAccount()));
+ Assert.ThrowsExactlyAsync(async () => await _service.DeleteEmailAccount(new EmailAccount()));
}
}
\ No newline at end of file
diff --git a/src/Tests/Grand.Business.Messages.Tests/Services/EmailSenderTests.cs b/src/Tests/Grand.Business.Messages.Tests/Services/EmailSenderTests.cs
index 6a293919a..e2a7b3cd4 100644
--- a/src/Tests/Grand.Business.Messages.Tests/Services/EmailSenderTests.cs
+++ b/src/Tests/Grand.Business.Messages.Tests/Services/EmailSenderTests.cs
@@ -27,7 +27,7 @@ public void Init()
[TestMethod]
public void SendEmailTest()
{
- Assert.ThrowsExceptionAsync(async () =>
+ Assert.ThrowsExactlyAsync(async () =>
await _sender.SendEmail(new EmailAccount { Host = "admin@admin.com" }, "subject", "body", "admin@store.com",
"admin store", "customer@email.com", "Customer name"));
}
diff --git a/src/Tests/Grand.Business.Messages.Tests/Services/MessageTemplateServiceTests.cs b/src/Tests/Grand.Business.Messages.Tests/Services/MessageTemplateServiceTests.cs
index fe59e61b8..1d296a708 100644
--- a/src/Tests/Grand.Business.Messages.Tests/Services/MessageTemplateServiceTests.cs
+++ b/src/Tests/Grand.Business.Messages.Tests/Services/MessageTemplateServiceTests.cs
@@ -38,7 +38,7 @@ public void Init()
[TestMethod]
public void CopyMessageTemplate_NullArrguemnt_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _service.CopyMessageTemplate(null));
+ Assert.ThrowsExactlyAsync(async () => await _service.CopyMessageTemplate(null));
}
[TestMethod]
diff --git a/src/Tests/Grand.Business.Messages.Tests/Services/QueuedEmailServiceTests.cs b/src/Tests/Grand.Business.Messages.Tests/Services/QueuedEmailServiceTests.cs
index 6588fc909..1bf4c0437 100644
--- a/src/Tests/Grand.Business.Messages.Tests/Services/QueuedEmailServiceTests.cs
+++ b/src/Tests/Grand.Business.Messages.Tests/Services/QueuedEmailServiceTests.cs
@@ -41,7 +41,7 @@ public async Task InsertQueuedEmail_ValidArgument_InvokeExpectedMethods()
[TestMethod]
public void InsertQueuedEmail_NullArguemnt_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () =>
+ Assert.ThrowsExactlyAsync(async () =>
await _service.InsertQueuedEmail(new QueuedEmail()));
}
@@ -56,7 +56,7 @@ public async Task UpdateQueuedEmail_ValidArgument_InvokeExpectedMethods()
[TestMethod]
public void UpdateQueuedEmai_NullArguemnt_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () =>
+ Assert.ThrowsExactlyAsync(async () =>
await _service.UpdateQueuedEmail(new QueuedEmail()));
}
@@ -85,7 +85,7 @@ public async Task DeleteAllEmails_ValidArgument_InvokeExpectedMethods()
[TestMethod]
public void DeleteQueuedEmai_NullArguemnt_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () =>
+ Assert.ThrowsExactlyAsync(async () =>
await _service.DeleteQueuedEmail(new QueuedEmail()));
}
}
\ No newline at end of file
diff --git a/src/Tests/Grand.Business.Storage.Tests/Services/DownloadServiceTests.cs b/src/Tests/Grand.Business.Storage.Tests/Services/DownloadServiceTests.cs
index b4af9e8ff..de8fc9013 100644
--- a/src/Tests/Grand.Business.Storage.Tests/Services/DownloadServiceTests.cs
+++ b/src/Tests/Grand.Business.Storage.Tests/Services/DownloadServiceTests.cs
@@ -32,7 +32,7 @@ public async Task GetDownloadById_InvokeExpectedMethod()
.Returns(Task.FromResult(new Download { DownloadUrl = "url", UseDownloadUrl = true }));
var result = await _service.GetDownloadById("id");
_repositoryMock.Verify(c => c.GetByIdAsync(It.IsAny()), Times.Once);
- Assert.AreEqual(result.DownloadUrl, "url");
+ Assert.AreEqual("url", result.DownloadUrl);
}
[TestMethod]
@@ -46,7 +46,7 @@ public async Task InsertDownload_InvokeExpectedMethod()
[TestMethod]
public void InsertDownload_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _service.InsertDownload(null));
+ Assert.ThrowsExactlyAsync(async () => await _service.InsertDownload(null));
}
[TestMethod]
@@ -60,7 +60,7 @@ public async Task UpdateDownload_InvokeExpectedMethod()
[TestMethod]
public void UpdateDownload_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _service.UpdateDownload(null));
+ Assert.ThrowsExactlyAsync(async () => await _service.UpdateDownload(null));
}
[TestMethod]
@@ -74,6 +74,6 @@ public async Task DeleteDownload_InvokeExpectedMethod()
[TestMethod]
public void DeleteDownload_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync(async () => await _service.DeleteDownload(null));
+ Assert.ThrowsExactlyAsync(async () => await _service.DeleteDownload(null));
}
}
\ No newline at end of file
diff --git a/src/Tests/Grand.Domain.Tests/Orders/OrderExtensionsTests.cs b/src/Tests/Grand.Domain.Tests/Orders/OrderExtensionsTests.cs
index 42a40fa8e..0331dcf68 100644
--- a/src/Tests/Grand.Domain.Tests/Orders/OrderExtensionsTests.cs
+++ b/src/Tests/Grand.Domain.Tests/Orders/OrderExtensionsTests.cs
@@ -60,7 +60,7 @@ public void HasItemsToAddToShipment_ReturnExpectedResult()
public void HasItemsToAddToShipment_NullOrder_ThrowException()
{
Order order = null;
- Assert.ThrowsException(() => order.HasItemsToAddToShipment());
+ Assert.ThrowsExactly(() => order.HasItemsToAddToShipment());
}
[TestMethod]
@@ -78,6 +78,6 @@ public void OrderTagExists_ReturnExpectedResult()
public void OrderTagExists_NullOrder_ThrowException()
{
Order order = null;
- Assert.ThrowsException(() => order.HasItemsToAddToShipment());
+ Assert.ThrowsExactly(() => order.HasItemsToAddToShipment());
}
}
\ No newline at end of file
diff --git a/src/Tests/Grand.Infrastructure.Tests/TypeConverters/Converter/RefreshTokenTypeConverterTests.cs b/src/Tests/Grand.Infrastructure.Tests/TypeConverters/Converter/RefreshTokenTypeConverterTests.cs
index 9e17d3456..2b57fd69f 100644
--- a/src/Tests/Grand.Infrastructure.Tests/TypeConverters/Converter/RefreshTokenTypeConverterTests.cs
+++ b/src/Tests/Grand.Infrastructure.Tests/TypeConverters/Converter/RefreshTokenTypeConverterTests.cs
@@ -60,7 +60,7 @@ public void ConvertToTest_decimal_Exception()
ValidTo = DateTime.UtcNow.AddDays(1)
};
- Assert.ThrowsException(() =>
+ Assert.ThrowsExactly(() =>
_ = refreshTokenTypeConverter.ConvertTo(refreshToken, typeof(decimal)));
}
}
\ No newline at end of file
diff --git a/src/Tests/Grand.SharedKernel.Tests/Extensions/CommonHelperTests.cs b/src/Tests/Grand.SharedKernel.Tests/Extensions/CommonHelperTests.cs
index 1fe43fd43..84e879e61 100644
--- a/src/Tests/Grand.SharedKernel.Tests/Extensions/CommonHelperTests.cs
+++ b/src/Tests/Grand.SharedKernel.Tests/Extensions/CommonHelperTests.cs
@@ -13,7 +13,7 @@ public class CommonHelperTests
[DataRow("email@email@email.pl")]
public void EnsureSubscriberEmailOrThrowTest_ThrowException(string email)
{
- Assert.ThrowsException(() => CommonHelper.EnsureSubscriberEmailOrThrow(email));
+ Assert.ThrowsExactly(() => CommonHelper.EnsureSubscriberEmailOrThrow(email));
}
[TestMethod]
@@ -67,7 +67,7 @@ public void GenerateRandomIntegerTest_True(int min, int max)
[DataRow(10, 1)]
public void GenerateRandomIntegerTest_ThrowException(int min, int max)
{
- Assert.ThrowsException(() => CommonHelper.GenerateRandomInteger(min, max));
+ Assert.ThrowsExactly(() => CommonHelper.GenerateRandomInteger(min, max));
}
[TestMethod]
@@ -101,7 +101,7 @@ public void EnsureMaximumLengthTest_Value_2_Post_True()
[DataRow("value", 1, "...")]
public void EnsureMaximumLengthTest_ThrowException(string str, int max, string post)
{
- Assert.ThrowsException(() => CommonHelper.EnsureMaximumLength(str, max, post));
+ Assert.ThrowsExactly(() => CommonHelper.EnsureMaximumLength(str, max, post));
}
[TestMethod]
@@ -127,7 +127,7 @@ public void ToTest_True()
public void ToTest_ThrowException()
{
object obj = "sample";
- Assert.ThrowsException(() => CommonHelper.To(obj, typeof(decimal)));
+ Assert.ThrowsExactly(() => CommonHelper.To(obj, typeof(decimal)));
}
[TestMethod]