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.

Update nuget packages to the latest version (#625)

Krzysztof Pajak6b53e683437a
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 @@
<PackageVersion Include="Azure.Monitor.OpenTelemetry.AspNetCore" Version="1.3.0" />
<PackageVersion Include="ExcelMapper" Version="5.2.598" />
<PackageVersion Include="Microsoft.AspNetCore.Http" Version="2.3.0" />
- <PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="9.0.5" />
- <PackageVersion Include="Microsoft.FeatureManagement.AspNetCore" Version="4.1.0" />
- <PackageVersion Include="NPOI" Version="2.7.3" />
- <PackageVersion Include="Scalar.AspNetCore" Version="2.4.8" />
+ <PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="9.0.9" />
+ <PackageVersion Include="Microsoft.FeatureManagement.AspNetCore" Version="4.3.0" />
+ <PackageVersion Include="NPOI" Version="2.7.5" />
+ <PackageVersion Include="Scalar.AspNetCore" Version="2.8.10" />
<PackageVersion Include="Scryber.Core" Version="6.0.4-beta" />
<PackageVersion Include="Scryber.Core.OpenType" Version="6.1.0-beta" />
- <PackageVersion Include="MailKit" Version="4.12.1" />
- <PackageVersion Include="AWSSDK.Core" Version="4.0.0.6" />
- <PackageVersion Include="AWSSDK.S3" Version="4.0.1.1" />
- <PackageVersion Include="Azure.Storage.Blobs" Version="12.24.0" />
- <PackageVersion Include="SixLabors.ImageSharp" Version="2.1.10" />
- <PackageVersion Include="SkiaSharp" Version="3.119.0" />
- <PackageVersion Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="3.119.0" />
+ <PackageVersion Include="MailKit" Version="4.14.0" />
+ <PackageVersion Include="AWSSDK.Core" Version="4.0.0.32" />
+ <PackageVersion Include="AWSSDK.S3" Version="4.0.7.7" />
+ <PackageVersion Include="Azure.Storage.Blobs" Version="12.25.1" />
+ <PackageVersion Include="SixLabors.ImageSharp" Version="3.1.11" />
+ <PackageVersion Include="SkiaSharp" Version="3.119.1" />
+ <PackageVersion Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="3.119.1" />
<PackageVersion Include="LiteDB" Version="5.0.21" />
- <PackageVersion Include="MongoDB.Bson" Version="3.4.0" />
- <PackageVersion Include="MongoDB.Driver" Version="3.4.0" />
+ <PackageVersion Include="MongoDB.Bson" Version="3.5.0" />
+ <PackageVersion Include="MongoDB.Driver" Version="3.5.0" />
<PackageVersion Include="DotLiquid" Version="2.3.197" />
<PackageVersion Include="FluentValidation.DependencyInjectionExtensions" Version="12.0.0" />
<PackageVersion Include="GoogleAuthenticator" Version="3.2.0" />
- <PackageVersion Include="Microsoft.Azure.AppConfiguration.AspNetCore" Version="8.2.0" />
- <PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.5" />
- <PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="9.0.5" />
- <PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="9.0.5" />
- <PackageVersion Include="Microsoft.Extensions.DependencyModel" Version="9.0.5" />
+ <PackageVersion Include="Microsoft.Azure.AppConfiguration.AspNetCore" Version="8.4.0" />
+ <PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="9.0.9" />
+ <PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="9.0.9" />
+ <PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="9.0.9" />
+ <PackageVersion Include="Microsoft.Extensions.DependencyModel" Version="9.0.9" />
<PackageVersion Include="AutoMapper" Version="14.0.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.14.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.14.0" />
<PackageVersion Include="MediatR" Version="12.5.0" />
<PackageVersion Include="Scrutor" Version="6.1.0" />
- <PackageVersion Include="StackExchange.Redis" Version="2.8.37" />
+ <PackageVersion Include="StackExchange.Redis" Version="2.9.25" />
<PackageVersion Include="FluentValidation" Version="12.0.0" />
- <PackageVersion Include="Microsoft.AspNetCore.JsonPatch" Version="9.0.5" />
- <PackageVersion Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="9.0.5" />
- <PackageVersion Include="Microsoft.AspNetCore.Authentication.Facebook" Version="9.0.5" />
- <PackageVersion Include="Microsoft.AspNetCore.Authentication.Google" Version="9.0.5" />
- <PackageVersion Include="Braintree" Version="5.33.0" />
- <PackageVersion Include="System.Configuration.ConfigurationManager" Version="9.0.5" />
- <PackageVersion Include="System.Linq.Dynamic.Core" Version="1.6.5" />
+ <PackageVersion Include="Microsoft.AspNetCore.JsonPatch" Version="9.0.9" />
+ <PackageVersion Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="9.0.9" />
+ <PackageVersion Include="Microsoft.AspNetCore.Authentication.Facebook" Version="9.0.9" />
+ <PackageVersion Include="Microsoft.AspNetCore.Authentication.Google" Version="9.0.9" />
+ <PackageVersion Include="Braintree" Version="5.35.0" />
+ <PackageVersion Include="System.Configuration.ConfigurationManager" Version="9.0.9" />
+ <PackageVersion Include="System.Linq.Dynamic.Core" Version="1.6.8" />
<PackageVersion Include="System.Xml.XPath.XmlDocument" Version="4.7.0" />
- <PackageVersion Include="Stripe.net" Version="48.2.0" />
+ <PackageVersion Include="Stripe.net" Version="49.0.0" />
<PackageVersion Include="elFinder.Net.AspNetCore" Version="1.5.0" />
<PackageVersion Include="elFinder.Net.Core" Version="1.5.0" />
<PackageVersion Include="elFinder.Net.Drivers.FileSystem" Version="1.5.0" />
- <PackageVersion Include="Azure.Extensions.AspNetCore.DataProtection.Blobs" Version="1.5.0" />
- <PackageVersion Include="Azure.Extensions.AspNetCore.DataProtection.Keys" Version="1.6.0" />
- <PackageVersion Include="Azure.Identity" Version="1.14.0" />
+ <PackageVersion Include="Azure.Extensions.AspNetCore.DataProtection.Blobs" Version="1.5.1" />
+ <PackageVersion Include="Azure.Extensions.AspNetCore.DataProtection.Keys" Version="1.6.1" />
+ <PackageVersion Include="Azure.Identity" Version="1.16.0" />
<PackageVersion Include="Flurl.Http" Version="4.0.2" />
- <PackageVersion Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="9.0.5" />
- <PackageVersion Include="NetEscapades.AspNetCore.SecurityHeaders" Version="1.1.0" />
- <PackageVersion Include="Wangkanai.Detection" Version="8.17.0" />
- <PackageVersion Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="9.0.5" />
- <PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
+ <PackageVersion Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="9.0.9" />
+ <PackageVersion Include="NetEscapades.AspNetCore.SecurityHeaders" Version="1.2.0" />
+ <PackageVersion Include="Wangkanai.Detection" Version="8.20.0" />
+ <PackageVersion Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="9.0.9" />
+ <PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.0.0" />
<PackageVersion Include="Moq" Version="4.20.72" />
- <PackageVersion Include="MSTest.TestAdapter" Version="3.9.1" />
- <PackageVersion Include="MSTest.TestFramework" Version="3.9.1" />
+ <PackageVersion Include="MSTest.TestAdapter" Version="3.11.0" />
+ <PackageVersion Include="MSTest.TestFramework" Version="3.11.0" />
<PackageVersion Include="coverlet.collector" Version="6.0.4" />
- <PackageVersion Include="NUnit" Version="4.3.2" />
- <PackageVersion Include="Aspire.Hosting.AppHost" Version="9.3.0" />
- <PackageVersion Include="Aspire.Hosting.MongoDB" Version="9.3.0" />
- <PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="9.5.0" />
- <PackageVersion Include="Microsoft.Extensions.ServiceDiscovery" Version="9.3.0" />
- <PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.12.0" />
- <PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="1.12.0" />
+ <PackageVersion Include="NUnit" Version="4.4.0" />
+ <PackageVersion Include="Aspire.Hosting.AppHost" Version="9.5.1" />
+ <PackageVersion Include="Aspire.Hosting.MongoDB" Version="9.5.1" />
+ <PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="9.9.0" />
+ <PackageVersion Include="Microsoft.Extensions.ServiceDiscovery" Version="9.5.1" />
+ <PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.13.0" />
+ <PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="1.13.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.12.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="1.12.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Runtime" Version="1.12.0" />
@@ -76,7 +76,7 @@
<PackageVersion Include="Aspire.Hosting.Orchestration.$(NETCoreSdkRuntimeIdentifier)" Version="9.0.0" />
</ItemGroup>
<ItemGroup>
- <PackageVersion Update="Aspire.Dashboard.Sdk.win-x64" Version="9.3.0" />
- <PackageVersion Update="Aspire.Hosting.Orchestration.win-x64" Version="9.3.0" />
+ <PackageVersion Update="Aspire.Dashboard.Sdk.win-x64" Version="9.5.1" />
+ <PackageVersion Update="Aspire.Hosting.Orchestration.win-x64" Version="9.5.1" />
</ItemGroup>
</Project>
\ 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 @@
<Target Name="CopyFile" AfterTargets="AfterBuild">
<ItemGroup>
- <CopyFiles Include="$(NuGetPackageRoot)\microsoft.aspnetcore.authentication.facebook\9.0.5\lib\net9.0\*.dll" />
+ <CopyFiles Include="$(NuGetPackageRoot)\microsoft.aspnetcore.authentication.facebook\9.0.9\lib\net9.0\*.dll" />
</ItemGroup>
<Copy SourceFiles="@(CopyFiles)" DestinationFolder="..\..\Web\Grand.Web\Plugins\Authentication.Facebook\" />
</Target>
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 @@
<Target Name="CopyFile" AfterTargets="AfterBuild">
<ItemGroup>
- <CopyFiles Include="$(NuGetPackageRoot)\microsoft.aspnetcore.authentication.google\9.0.5\lib\net9.0\*.dll" />
+ <CopyFiles Include="$(NuGetPackageRoot)\microsoft.aspnetcore.authentication.google\9.0.9\lib\net9.0\*.dll" />
</ItemGroup>
<Copy SourceFiles="@(CopyFiles)" DestinationFolder="..\..\Web\Grand.Web\Plugins\Authentication.Google\" />
</Target>
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 @@
<Target Name="CopyFile" AfterTargets="AfterBuild">
<ItemGroup>
- <CopyFiles Include="$(NuGetPackageRoot)\braintree\5.33.0\lib\netstandard2.0\*.*" />
+ <CopyFiles Include="$(NuGetPackageRoot)\braintree\5.35.0\lib\netstandard2.0\*.*" />
<CopyFiles Include="$(NuGetPackageRoot)\system.xml.xpath.xmldocument\4.7.0\lib\netstandard2.0\*.*" />
</ItemGroup>
<Copy SourceFiles="@(CopyFiles)" DestinationFolder="..\..\Web\Grand.Web\Plugins\Payments.BrainTree\" />
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 @@
<Target Name="CopyFile" AfterTargets="AfterBuild">
<ItemGroup>
- <CopyFiles Include="$(NuGetPackageRoot)\stripe.net\48.2.0\lib\net8.0\*.*" />
+ <CopyFiles Include="$(NuGetPackageRoot)\stripe.net\49.0.0\lib\net8.0\*.*" />
<CopyFiles Include="$(NuGetPackageRoot)\newtonsoft.json\13.0.3\lib\net6.0\*.dll" />
</ItemGroup>
<Copy SourceFiles="@(CopyFiles)" DestinationFolder="..\..\Web\Grand.Web\Plugins\Payments.StripeCheckout\" />
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 class CookieAuthenticationServiceTests
[TestMethod]
public async Task SignIn_NullCustomer_ThrowException()
{
- await Assert.ThrowsExceptionAsync<ArgumentNullException>(async () =>
+ await Assert.ThrowsExactlyAsync<ArgumentNullException>(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 class UpdateProductReviewTotalsCommandHandlerTest
{
var request = new UpdateProductReviewTotalsCommand();
- await Assert.ThrowsExceptionAsync<ArgumentNullException>(
+ await Assert.ThrowsExactlyAsync<ArgumentNullException>(
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 class CategoryServiceTests
[TestMethod]
public void InsertCategory_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _categoryService.InsertCategory(null),
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(async () => await _categoryService.InsertCategory(null),
"category");
}
@@ -68,7 +68,7 @@ public class CategoryServiceTests
[TestMethod]
public void UpdateCategory_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _categoryService.UpdateCategory(null),
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(async () => await _categoryService.UpdateCategory(null),
"category");
}
@@ -161,7 +161,7 @@ public class CategoryServiceTests
[TestMethod]
public void DeleteProductCategory_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(
async () => await _productCategoryService.DeleteProductCategory(null, "id"), "productCategory");
}
@@ -180,7 +180,7 @@ public class CategoryServiceTests
[TestMethod]
public void InsertProductCategory_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(
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 class CollectionServiceTests
[TestMethod]
public void DeleteCollection_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _collectionService.DeleteCollection(null));
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(async () => await _collectionService.DeleteCollection(null));
}
[TestMethod]
public void InsertCollection_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _collectionService.InsertCollection(null));
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(async () => await _collectionService.InsertCollection(null));
}
[TestMethod]
public void UpdateCollection_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _collectionService.UpdateCollection(null));
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(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 class SearchTermServiceTests
[TestMethod]
public void InsertSearchTerm_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _service.InsertSearchTerm(null));
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(async () => await _service.InsertSearchTerm(null));
}
[TestMethod]
public void UpdateSearchTerm_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _service.UpdateSearchTerm(null));
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(async () => await _service.UpdateSearchTerm(null));
}
[TestMethod]
public void DeleteSearchTerm_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _service.DeleteSearchTerm(null));
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(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 class CancelOrderCommandHandlerTests
var command = new CancelOrderCommand {
Order = null
};
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _handler.Handle(command, default));
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(async () => await _handler.Handle(command, default));
}
[TestMethod]
@@ -63,7 +63,7 @@ public class CancelOrderCommandHandlerTests
var command = new CancelOrderCommand {
Order = new Order { OrderStatusId = (int)OrderStatusSystem.Cancelled }
};
- Assert.ThrowsExceptionAsync<Exception>(async () => await _handler.Handle(command, default));
+ Assert.ThrowsExactlyAsync<Exception>(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 class PaymentExtensionsTests
public void IsPaymentMethodActive_NullSettings_ThrowException()
{
PaymentSettings settings = null;
- Assert.ThrowsException<ArgumentNullException>(() => _providerMock.Object.IsPaymentMethodActive(settings));
+ Assert.ThrowsExactly<ArgumentNullException>(() => _providerMock.Object.IsPaymentMethodActive(settings));
}
[TestMethod]
@@ -40,6 +40,6 @@ public class PaymentExtensionsTests
{
IPaymentProvider provider = null;
var settings = new PaymentSettings();
- Assert.ThrowsException<ArgumentNullException>(() => provider.IsPaymentMethodActive(settings));
+ Assert.ThrowsExactly<ArgumentNullException>(() => 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 class ShippingExtensionsTests
{
IShippingRateCalculationProvider provider = null;
var settings = new ShippingProviderSettings();
- Assert.ThrowsException<ArgumentNullException>(() => provider.IsShippingRateMethodActive(settings));
+ Assert.ThrowsExactly<ArgumentNullException>(() => provider.IsShippingRateMethodActive(settings));
}
[TestMethod]
@@ -36,7 +36,7 @@ public class ShippingExtensionsTests
{
var providerMock = new Mock<IShippingRateCalculationProvider>();
var provider = providerMock.Object;
- Assert.ThrowsException<ArgumentNullException>(() => provider.IsShippingRateMethodActive(null));
+ Assert.ThrowsExactly<ArgumentNullException>(() => 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 class CheckoutAttributeServiceTests
[TestMethod]
public void InsertCheckoutAttribute_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _service.InsertCheckoutAttribute(null));
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(async () => await _service.InsertCheckoutAttribute(null));
}
[TestMethod]
@@ -59,7 +59,7 @@ public class CheckoutAttributeServiceTests
[TestMethod]
public void UpdateCheckoutAttribute_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _service.UpdateCheckoutAttribute(null));
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(async () => await _service.UpdateCheckoutAttribute(null));
}
[TestMethod]
@@ -74,6 +74,6 @@ public class CheckoutAttributeServiceTests
[TestMethod]
public void DeleteCheckoutAttribute_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _service.DeleteCheckoutAttribute(null));
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(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 class GiftVoucherServiceTests
[TestMethod]
public void InsertGiftVoucher_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _service.InsertGiftVoucher(null));
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(async () => await _service.InsertGiftVoucher(null));
}
[TestMethod]
@@ -64,7 +64,7 @@ public class GiftVoucherServiceTests
[TestMethod]
public void UpdateGiftVoucher_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _service.UpdateGiftVoucher(null));
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(async () => await _service.UpdateGiftVoucher(null));
}
[TestMethod]
@@ -78,6 +78,6 @@ public class GiftVoucherServiceTests
[TestMethod]
public void DeleteGiftVoucher_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _service.DeleteGiftVoucher(null));
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(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 class OrderServiceTests
[TestMethod]
public void UpdateOrder_NullArguments_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _service.UpdateOrder(null));
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(async () => await _service.UpdateOrder(null));
}
[TestMethod]
@@ -50,7 +50,7 @@ public class OrderServiceTests
[TestMethod]
public void InsertOrderNote_NullArguments_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _service.InsertOrderNote(null));
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(async () => await _service.InsertOrderNote(null));
}
[TestMethod]
@@ -64,6 +64,6 @@ public class OrderServiceTests
[TestMethod]
public void DeleteOrderNote_NullArguments_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _service.DeleteOrderNote(null));
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(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 class OrderStatusServiceTests
[TestMethod]
public void Insert_NullArguemnt_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _service.Insert(null));
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(async () => await _service.Insert(null));
}
[TestMethod]
@@ -53,7 +53,7 @@ public class OrderStatusServiceTests
[TestMethod]
public void Update_NullArguemnt_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _service.Update(null));
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(async () => await _service.Update(null));
}
[TestMethod]
@@ -68,6 +68,6 @@ public class OrderStatusServiceTests
[TestMethod]
public void Delete_NullArguemnt_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _service.Delete(null));
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(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 class PaymentServiceTests
{
_paymentProviderMock.Setup(c => c.SystemName).Returns("systemName2");
var request = new PaymentTransaction { PaymentMethodSystemName = "systemName", TransactionAmount = 500 };
- Assert.ThrowsExceptionAsync<GrandException>(async () => await _paymentService.ProcessPayment(request));
+ Assert.ThrowsExactlyAsync<GrandException>(async () => await _paymentService.ProcessPayment(request));
}
[TestMethod]
@@ -130,7 +130,7 @@ public class PaymentServiceTests
PaymentMethodSystemName = "systemName2", TransactionAmount = 500,
TransactionStatus = TransactionStatus.Authorized
};
- Assert.ThrowsExceptionAsync<GrandException>(async () => await _paymentService.PostProcessPayment(request),
+ Assert.ThrowsExactlyAsync<GrandException>(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 class PaymentTransactionServiceTests
[TestMethod]
public void InsertPaymentTransaction_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _service.InsertPaymentTransaction(null));
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(async () => await _service.InsertPaymentTransaction(null));
}
[TestMethod]
@@ -48,7 +48,7 @@ public class PaymentTransactionServiceTests
[TestMethod]
public void UpdatePaymentTransaction_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _service.UpdatePaymentTransaction(null));
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(async () => await _service.UpdatePaymentTransaction(null));
}
[TestMethod]
@@ -62,6 +62,6 @@ public class PaymentTransactionServiceTests
[TestMethod]
public void DeletePaymentTransaction_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _service.DeletePaymentTransaction(null));
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(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 class DeliveryDateServiceTests
[TestMethod]
public void InsertDeliveryDate_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _service.InsertDeliveryDate(null));
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(async () => await _service.InsertDeliveryDate(null));
}
[TestMethod]
@@ -53,7 +53,7 @@ public class DeliveryDateServiceTests
[TestMethod]
public void UpdateDeliveryDate_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _service.UpdateDeliveryDate(null));
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(async () => await _service.UpdateDeliveryDate(null));
}
[TestMethod]
@@ -68,6 +68,6 @@ public class DeliveryDateServiceTests
[TestMethod]
public void DeleteDeliveryDate_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _service.DeleteDeliveryDate(null));
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(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 class PickupPointServiceTests
[TestMethod]
public void InsertPickupPoint_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _service.InsertPickupPoint(null));
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(async () => await _service.InsertPickupPoint(null));
}
[TestMethod]
@@ -54,7 +54,7 @@ public class PickupPointServiceTests
[TestMethod]
public void UpdatePickupPoint_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _service.UpdatePickupPoint(null));
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(async () => await _service.UpdatePickupPoint(null));
}
[TestMethod]
@@ -69,6 +69,6 @@ public class PickupPointServiceTests
[TestMethod]
public void DeletePickupPoint_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _service.DeletePickupPoint(null));
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(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 class ShippingMethodServiceTests
[TestMethod]
public void InsertShippingMethod_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _service.InsertShippingMethod(null));
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(async () => await _service.InsertShippingMethod(null));
}
[TestMethod]
@@ -54,7 +54,7 @@ public class ShippingMethodServiceTests
[TestMethod]
public void UpdateShippingMethod_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _service.UpdateShippingMethod(null));
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(async () => await _service.UpdateShippingMethod(null));
}
[TestMethod]
@@ -69,6 +69,6 @@ public class ShippingMethodServiceTests
[TestMethod]
public void DeleteShippingMethod_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _service.DeleteShippingMethod(null));
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(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 class WarehouseServiceTests
[TestMethod]
public void InsertWarehouse_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _service.InsertWarehouse(null));
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(async () => await _service.InsertWarehouse(null));
}
[TestMethod]
@@ -55,7 +55,7 @@ public class WarehouseServiceTests
[TestMethod]
public void UpdateWarehouse_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _service.UpdateWarehouse(null));
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(async () => await _service.UpdateWarehouse(null));
}
[TestMethod]
@@ -70,6 +70,6 @@ public class WarehouseServiceTests
[TestMethod]
public void DeleteWarehouse_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _service.DeleteWarehouse(null));
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(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 class BlogServiceTests
[TestMethod]
public void DeleteBlogPost_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _blogService.DeleteBlogPost(null),
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(async () => await _blogService.DeleteBlogPost(null),
"blogPost");
}
@@ -60,7 +60,7 @@ public class BlogServiceTests
[TestMethod]
public void InsertBlogPost_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _blogService.InsertBlogPost(null),
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(async () => await _blogService.InsertBlogPost(null),
"blogPost");
}
@@ -83,7 +83,7 @@ public class BlogServiceTests
[TestMethod]
public void UpdateBlogPost_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _blogService.UpdateBlogPost(null),
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(async () => await _blogService.UpdateBlogPost(null),
"blogPost");
}
@@ -98,7 +98,7 @@ public class BlogServiceTests
[TestMethod]
public void InsertBlogProductInsertBlogProduct_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _blogService.InsertBlogProduct(null),
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(async () => await _blogService.InsertBlogProduct(null),
"blogProduct");
}
@@ -113,7 +113,7 @@ public class BlogServiceTests
[TestMethod]
public void UpdateBlogProduct_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _blogService.UpdateBlogProduct(null),
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(async () => await _blogService.UpdateBlogProduct(null),
"blogProduct");
}
@@ -128,7 +128,7 @@ public class BlogServiceTests
[TestMethod]
public void DeleteBlogProduct_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _blogService.DeleteBlogProduct(null),
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(async () => await _blogService.DeleteBlogProduct(null),
"blogProduct");
}
@@ -143,7 +143,7 @@ public class BlogServiceTests
[TestMethod]
public void InsertBlogCategory_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _blogService.InsertBlogCategory(null),
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(async () => await _blogService.InsertBlogCategory(null),
"blogCategory");
}
@@ -158,7 +158,7 @@ public class BlogServiceTests
[TestMethod]
public void UpdateBlogCategory_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _blogService.UpdateBlogCategory(null),
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(async () => await _blogService.UpdateBlogCategory(null),
"blogCategory");
}
@@ -173,7 +173,7 @@ public class BlogServiceTests
[TestMethod]
public void DeleteBlogCategory_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _blogService.DeleteBlogCategory(null),
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(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 class TranslateExtensionsTests
public void GetTranslation_NullArgument_ThrowException()
{
Product product = null;
- Assert.ThrowsException<ArgumentNullException>(() => product.GetTranslation(c => c.Name, "PL"));
+ Assert.ThrowsExactly<ArgumentNullException>(() => product.GetTranslation(c => c.Name, "PL"));
}
[TestMethod]
public void GetTranslation_ExpressionUseMethod_ThrowException()
{
var product = new Product();
- Assert.ThrowsException<ArgumentException>(() =>
+ Assert.ThrowsExactly<ArgumentException>(() =>
product.GetTranslation(c => c.ParseRequiredProductIds().First(), "PL"));
}
@@ -60,7 +60,7 @@ public class TranslateExtensionsTests
{
var translationServiceMock = new Mock<ITranslationService>();
var fake = new FakeStruct();
- Assert.ThrowsException<ArgumentException>(() => fake.GetTranslationEnum(translationServiceMock.Object, "PL"));
+ Assert.ThrowsExactly<ArgumentException>(() => 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 class SettingServiceTests
[TestMethod]
public void InsertSetting_NullArgument_TrhowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _service.InsertSetting(null));
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(async () => await _service.InsertSetting(null));
}
[TestMethod]
@@ -47,7 +47,7 @@ public class SettingServiceTests
[TestMethod]
public void UpdateSetting_NullArgument_TrhowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _service.UpdateSetting(null));
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(async () => await _service.UpdateSetting(null));
}
[TestMethod]
@@ -61,6 +61,6 @@ public class SettingServiceTests
[TestMethod]
public void DeleteSetting_NullArgument_TrhowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _service.DeleteSetting(null));
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(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 class CurrencyServiceTests
_cacheManager.Setup(c => c.GetAsync(It.IsAny<string>(), It.IsAny<Func<Task<Currency>>>()))
.Returns(Task.FromResult(currencyUSD));
currencyEUR.Rate = 0;
- Assert.ThrowsExceptionAsync<GrandException>(async () =>
+ Assert.ThrowsExactlyAsync<GrandException>(async () =>
await _currencyService.ConvertToPrimaryExchangeRateCurrency(100, currencyEUR));
}
@@ -153,7 +153,7 @@ public class CurrencyServiceTests
{
_cacheManager.Setup(c => c.GetAsync(It.IsAny<string>(), It.IsAny<Func<Task<Currency>>>()))
.Returns(Task.FromResult<Currency>(null));
- Assert.ThrowsExceptionAsync<Exception>(async () =>
+ Assert.ThrowsExactlyAsync<Exception>(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 class HistoryServiceTests
[TestMethod]
public void SaveObject_NullObject_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _historyService.SaveObject<Product>(null),
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(async () => await _historyService.SaveObject<Product>(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 class EncryptionServiceTests
{
var privateKey = "secure key.";
var toEncrypte = "text to encrypte...";
- Assert.ThrowsException<Exception>(() => _encryptionService.EncryptText(toEncrypte, privateKey));
+ Assert.ThrowsExactly<Exception>(() => _encryptionService.EncryptText(toEncrypte, privateKey));
}
[TestMethod]
@@ -91,6 +91,6 @@ public class EncryptionServiceTests
{
var privateKey = "secure key.";
var toDescrypt = "gdfgdfgt45gfdfg";
- Assert.ThrowsException<Exception>(() => _encryptionService.DecryptText(toDescrypt, privateKey));
+ Assert.ThrowsExactly<Exception>(() => _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 class StoreServiceTests
//can not remove store if it is only one
_cacheMock.Setup(c => c.GetAsync(It.IsAny<string>(), It.IsAny<Func<Task<List<Store>>>>()))
.Returns(Task.FromResult(new List<Store> { new() }));
- Assert.ThrowsExceptionAsync<Exception>(async () => await _service.DeleteStore(new Store()));
+ Assert.ThrowsExactlyAsync<Exception>(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 class AffiliateExtensionsTests
public void GetFullName_NullParameter_ThrowException()
{
Affiliate affiliate = null;
- Assert.ThrowsException<ArgumentNullException>(() => affiliate.GetFullName());
+ Assert.ThrowsExactly<ArgumentNullException>(() => affiliate.GetFullName());
}
[TestMethod]
@@ -68,14 +68,14 @@ public class AffiliateExtensionsTests
public void GenerateUrl_NullAffiliate_ThrowException()
{
Affiliate affiliate = null;
- Assert.ThrowsException<ArgumentNullException>(() => affiliate.GenerateUrl(null), "affiliate");
+ Assert.ThrowsExactly<ArgumentNullException>(() => affiliate.GenerateUrl(null), "affiliate");
}
[TestMethod]
public void GenerateUrl_NullWebHelper_ThrowException()
{
var affiliate = new Affiliate();
- Assert.ThrowsException<ArgumentNullException>(() => affiliate.GenerateUrl(null), "webHelper");
+ Assert.ThrowsExactly<ArgumentNullException>(() => 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 class AffiliateServiceTests
[TestMethod]
public async Task UpdateAffiliate_NullParameter_ThrwoException()
{
- await Assert.ThrowsExceptionAsync<ArgumentNullException>(
+ await Assert.ThrowsExactlyAsync<ArgumentNullException>(
async () => await _affiliateService.UpdateAffiliate(null), "affiliate");
}
[TestMethod]
public async Task InsertAffiliate_NullParameter_ThrwoException()
{
- await Assert.ThrowsExceptionAsync<ArgumentNullException>(
+ await Assert.ThrowsExactlyAsync<ArgumentNullException>(
async () => await _affiliateService.InsertAffiliate(null), "affiliate");
}
[TestMethod]
public async Task DeleteAffiliate_NullParameter_ThrwoException()
{
- await Assert.ThrowsExceptionAsync<ArgumentNullException>(
+ await Assert.ThrowsExactlyAsync<ArgumentNullException>(
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 class CourseActionServiceTests
[TestMethod]
public void InsertAsync_NullArgument_ThrowExcepiton()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _courseActionService.InsertAsync(null),
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(async () => await _courseActionService.InsertAsync(null),
"courseAction");
}
@@ -41,7 +41,7 @@ public class CourseActionServiceTests
[TestMethod]
public void Update_NullArgument_ThrowExcepiton()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _courseActionService.Update(null),
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(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 class CoursesServiceTests
[TestMethod]
public void Delete_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _courseService.Delete(null), "course");
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(async () => await _courseService.Delete(null), "course");
}
[TestMethod]
@@ -49,7 +49,7 @@ public class CoursesServiceTests
[TestMethod]
public void Insert_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _courseService.Insert(null), "course");
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(async () => await _courseService.Insert(null), "course");
}
[TestMethod]
@@ -63,7 +63,7 @@ public class CoursesServiceTests
[TestMethod]
public void Update_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _courseService.Update(null), "course");
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(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 class DocumentServiceTests
[TestMethod]
public async Task DeleteDocument_NullArgument_ThrowException()
{
- await Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _documentService.Delete(null),
+ await Assert.ThrowsExactlyAsync<ArgumentNullException>(async () => await _documentService.Delete(null),
"document");
}
@@ -48,7 +48,7 @@ public class DocumentServiceTests
[TestMethod]
public async Task InsertDocument_NullArgument_ThrowException()
{
- await Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _documentService.Insert(null),
+ await Assert.ThrowsExactlyAsync<ArgumentNullException>(async () => await _documentService.Insert(null),
"document");
}
@@ -71,6 +71,6 @@ public class DocumentServiceTests
[TestMethod]
public void UpdateDocument_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _documentService.Update(null), "document");
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(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 class DocumentTypeServiceTests
[TestMethod]
public async Task DeleteDocumentType_NullArgument_ThrowException()
{
- await Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _documentTypeService.Delete(null),
+ await Assert.ThrowsExactlyAsync<ArgumentNullException>(async () => await _documentTypeService.Delete(null),
"documentType");
}
@@ -67,7 +67,7 @@ public class DocumentTypeServiceTests
[TestMethod]
public async Task InsertDocumentType_NullArgument_ThrowException()
{
- await Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _documentTypeService.Insert(null),
+ await Assert.ThrowsExactlyAsync<ArgumentNullException>(async () => await _documentTypeService.Insert(null),
"documentType");
}
@@ -90,7 +90,7 @@ public class DocumentTypeServiceTests
[TestMethod]
public void UpdateDocumentType_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _documentTypeService.Update(null),
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(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 class NewsLetterSubscriptionServiceTests
var newsLetterSubscription = new NewsLetterSubscription {
Email = email
};
- Assert.ThrowsExceptionAsync<GrandException>(async () =>
+ Assert.ThrowsExactlyAsync<GrandException>(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 class NewsletterCategoryServiceTests
[TestMethod]
public async Task DeleteNewsletterCategory_NullArgument_ThrowException()
{
- await Assert.ThrowsExceptionAsync<ArgumentNullException>(
+ await Assert.ThrowsExactlyAsync<ArgumentNullException>(
async () => await _newsletterCategoryService.DeleteNewsletterCategory(null), "newslettercategory");
}
@@ -48,7 +48,7 @@ public class NewsletterCategoryServiceTests
[TestMethod]
public async Task InsertNewsletterCategory_NullArgument_ThrowException()
{
- await Assert.ThrowsExceptionAsync<ArgumentNullException>(
+ await Assert.ThrowsExactlyAsync<ArgumentNullException>(
async () => await _newsletterCategoryService.InsertNewsletterCategory(null), "newslettercategory");
}
@@ -71,7 +71,7 @@ public class NewsletterCategoryServiceTests
[TestMethod]
public void UpdateNewsletterCategory_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(
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 class EmailAccountServiceTests
//we can't delete account if exist only one
_cacheMock.Setup(c => c.GetAsync(It.IsAny<string>(), It.IsAny<Func<Task<List<EmailAccount>>>>()))
.Returns(Task.FromResult(new List<EmailAccount> { new() }));
- Assert.ThrowsExceptionAsync<GrandException>(async () => await _service.DeleteEmailAccount(new EmailAccount()));
+ Assert.ThrowsExactlyAsync<GrandException>(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 class EmailSenderTests
[TestMethod]
public void SendEmailTest()
{
- Assert.ThrowsExceptionAsync<SocketException>(async () =>
+ Assert.ThrowsExactlyAsync<SocketException>(async () =>
await _sender.SendEmail(new EmailAccount { Host = "[email protected]" }, "subject", "body", "[email protected]",
"admin store", "[email protected]", "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 class MessageTemplateServiceTests
[TestMethod]
public void CopyMessageTemplate_NullArrguemnt_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _service.CopyMessageTemplate(null));
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(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 class QueuedEmailServiceTests
[TestMethod]
public void InsertQueuedEmail_NullArguemnt_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () =>
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(async () =>
await _service.InsertQueuedEmail(new QueuedEmail()));
}
@@ -56,7 +56,7 @@ public class QueuedEmailServiceTests
[TestMethod]
public void UpdateQueuedEmai_NullArguemnt_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () =>
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(async () =>
await _service.UpdateQueuedEmail(new QueuedEmail()));
}
@@ -85,7 +85,7 @@ public class QueuedEmailServiceTests
[TestMethod]
public void DeleteQueuedEmai_NullArguemnt_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () =>
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(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 class DownloadServiceTests
.Returns(Task.FromResult(new Download { DownloadUrl = "url", UseDownloadUrl = true }));
var result = await _service.GetDownloadById("id");
_repositoryMock.Verify(c => c.GetByIdAsync(It.IsAny<string>()), Times.Once);
- Assert.AreEqual(result.DownloadUrl, "url");
+ Assert.AreEqual("url", result.DownloadUrl);
}
[TestMethod]
@@ -46,7 +46,7 @@ public class DownloadServiceTests
[TestMethod]
public void InsertDownload_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _service.InsertDownload(null));
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(async () => await _service.InsertDownload(null));
}
[TestMethod]
@@ -60,7 +60,7 @@ public class DownloadServiceTests
[TestMethod]
public void UpdateDownload_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _service.UpdateDownload(null));
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(async () => await _service.UpdateDownload(null));
}
[TestMethod]
@@ -74,6 +74,6 @@ public class DownloadServiceTests
[TestMethod]
public void DeleteDownload_NullArgument_ThrowException()
{
- Assert.ThrowsExceptionAsync<ArgumentNullException>(async () => await _service.DeleteDownload(null));
+ Assert.ThrowsExactlyAsync<ArgumentNullException>(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 class OrderExtensionsTests
public void HasItemsToAddToShipment_NullOrder_ThrowException()
{
Order order = null;
- Assert.ThrowsException<ArgumentNullException>(() => order.HasItemsToAddToShipment());
+ Assert.ThrowsExactly<ArgumentNullException>(() => order.HasItemsToAddToShipment());
}
[TestMethod]
@@ -78,6 +78,6 @@ public class OrderExtensionsTests
public void OrderTagExists_NullOrder_ThrowException()
{
Order order = null;
- Assert.ThrowsException<ArgumentNullException>(() => order.HasItemsToAddToShipment());
+ Assert.ThrowsExactly<ArgumentNullException>(() => 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 class RefreshTokenTypeConverterTests
ValidTo = DateTime.UtcNow.AddDays(1)
};
- Assert.ThrowsException<NotSupportedException>(() =>
+ Assert.ThrowsExactly<NotSupportedException>(() =>
_ = 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 protected]")]
public void EnsureSubscriberEmailOrThrowTest_ThrowException(string email)
{
- Assert.ThrowsException<GrandException>(() => CommonHelper.EnsureSubscriberEmailOrThrow(email));
+ Assert.ThrowsExactly<GrandException>(() => CommonHelper.EnsureSubscriberEmailOrThrow(email));
}
[TestMethod]
@@ -67,7 +67,7 @@ public class CommonHelperTests
[DataRow(10, 1)]
public void GenerateRandomIntegerTest_ThrowException(int min, int max)
{
- Assert.ThrowsException<ArgumentOutOfRangeException>(() => CommonHelper.GenerateRandomInteger(min, max));
+ Assert.ThrowsExactly<ArgumentOutOfRangeException>(() => CommonHelper.GenerateRandomInteger(min, max));
}
[TestMethod]
@@ -101,7 +101,7 @@ public class CommonHelperTests
[DataRow("value", 1, "...")]
public void EnsureMaximumLengthTest_ThrowException(string str, int max, string post)
{
- Assert.ThrowsException<ArgumentOutOfRangeException>(() => CommonHelper.EnsureMaximumLength(str, max, post));
+ Assert.ThrowsExactly<ArgumentOutOfRangeException>(() => CommonHelper.EnsureMaximumLength(str, max, post));
}
[TestMethod]
@@ -127,7 +127,7 @@ public class CommonHelperTests
public void ToTest_ThrowException()
{
object obj = "sample";
- Assert.ThrowsException<ArgumentException>(() => CommonHelper.To(obj, typeof(decimal)));
+ Assert.ThrowsExactly<ArgumentException>(() => CommonHelper.To(obj, typeof(decimal)));
}
[TestMethod]