Skip to content

Commit

Permalink
Upgrade to ABP 8.3.2 (#287)
Browse files Browse the repository at this point in the history
* Upgrade to ABP 8.3.2

* Fix UTs
  • Loading branch information
gdlcf88 authored Oct 27, 2024
1 parent eeedf08 commit b791b76
Show file tree
Hide file tree
Showing 91 changed files with 4,837 additions and 20,597 deletions.
12 changes: 6 additions & 6 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project>
<PropertyGroup>

<AbpVersion>8.2.0</AbpVersion>
<EasyAbpAbpTreesModuleVersion>2.17.0</EasyAbpAbpTreesModuleVersion>
<EasyAbpPaymentServiceModuleVersion>2.12.0</EasyAbpPaymentServiceModuleVersion>
<EasyAbpAbpTagHelperPlusModuleVersion>2.2.0</EasyAbpAbpTagHelperPlusModuleVersion>
<EasyAbpBookingServiceModuleVersion>0.11.1</EasyAbpBookingServiceModuleVersion>
<AbpVersion>8.3.2</AbpVersion>
<EasyAbpAbpTreesModuleVersion>2.18.1</EasyAbpAbpTreesModuleVersion>
<EasyAbpPaymentServiceModuleVersion>2.13.0</EasyAbpPaymentServiceModuleVersion>
<EasyAbpAbpTagHelperPlusModuleVersion>2.3.0</EasyAbpAbpTagHelperPlusModuleVersion>
<EasyAbpBookingServiceModuleVersion>0.13.0</EasyAbpBookingServiceModuleVersion>
<DaprSdkVersion>1.12.0</DaprSdkVersion>
<OrleansVersion>3.7.1</OrleansVersion>
<OrleansVersion>3.7.2</OrleansVersion>
<NodaMoneyVersion>1.0.5</NodaMoneyVersion>

</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion common.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<LangVersion>latest</LangVersion>
<Version>5.3.0</Version>
<Version>5.4.0</Version>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>EasyAbp Team</Authors>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>EasyAbp.EShop.Orders.Plugins.Coupons</RootNamespace>
</PropertyGroup>

Expand All @@ -10,7 +10,7 @@
<ProjectReference Include="..\..\src\EasyAbp.EShop.Orders.Plugins.Coupons\EasyAbp.EShop.Orders.Plugins.Coupons.csproj" />
<ProjectReference Include="..\EasyAbp.EShop.Plugins.Coupons.Application.Tests\EasyAbp.EShop.Plugins.Coupons.Application.Tests.csproj" />
<ProjectReference Include="..\EasyAbp.EShop.Plugins.Coupons.Domain.Tests\EasyAbp.EShop.Plugins.Coupons.Domain.Tests.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Threading.Tasks;
using EasyAbp.EShop.Orders;
using EasyAbp.EShop.Orders.Orders;
using EasyAbp.EShop.Orders.Plugins.Coupons.OrderDiscount;
using EasyAbp.EShop.Plugins.Coupons.CouponTemplates;
using EasyAbp.EShop.Products.Products;
using Shouldly;
Expand All @@ -26,25 +27,28 @@ public OrdersAppServiceTests()

[Theory]
//Meet the condition discount 1 time
[InlineData(5, 2.3, 11, 2.3, CouponType.Normal)]
[InlineData(5, 2.3, 10, 2.3, CouponType.Normal)]
[InlineData(5, 2.3, 9, 2.3, CouponType.Normal)]
[InlineData(5, 2.3, 11, 2.3, CouponType.Normal, false)]
[InlineData(5, 2.3, 10, 2.3, CouponType.Normal, false)]
[InlineData(5, 2.3, 9, 2.3, CouponType.Normal, false)]
//The discount condition is not met
[InlineData(5, 2.3, 4, 0, CouponType.Normal)]
[InlineData(5, 2.3, 4, 0, CouponType.Normal, true)]

//Meet the condition discount 2 time
[InlineData(5, 2.3, 11, 4.6, CouponType.PerMeet)]
[InlineData(5, 2.3, 10, 4.6, CouponType.PerMeet)]
[InlineData(5, 2.3, 11, 4.6, CouponType.PerMeet, false)]
[InlineData(5, 2.3, 10, 4.6, CouponType.PerMeet, false)]

//Meet the condition discount 1 time
[InlineData(5, 2.3, 9, 2.3, CouponType.PerMeet)]
[InlineData(5, 2.3, 9, 2.3, CouponType.PerMeet, false)]
//The discount condition is not met
[InlineData(5, 2.3, 4, 0, CouponType.PerMeet)]
public async Task Should_CouponType_DiscountAmount(decimal couponConditionAmount, decimal couponDiscountAmount, decimal productSkuPrice,decimal discountAmount, CouponType couponType)
[InlineData(5, 2.3, 4, 0, CouponType.PerMeet, true)]
public async Task Should_CouponType_DiscountAmount(decimal couponConditionAmount, decimal couponDiscountAmount,
decimal productSkuPrice, decimal discountAmount, CouponType couponType, bool throws)
{
var template = new CouponTemplate(Guid.NewGuid(), null, null, couponType, "UName", "DName", "Desc", null
, DateTime.Now.AddDays(-1), DateTime.Now.AddDays(1), couponConditionAmount, couponDiscountAmount, "USD", true, null);
var coupon = new Coupon(Guid.NewGuid(), null, template.Id, Guid.Parse("2e701e62-0953-4dd3-910b-dc6cc93ccb0d"), null, null);
, DateTime.Now.AddDays(-1), DateTime.Now.AddDays(1), couponConditionAmount, couponDiscountAmount, "USD",
true, null);
var coupon = new Coupon(Guid.NewGuid(), null, template.Id,
Guid.Parse("2e701e62-0953-4dd3-910b-dc6cc93ccb0d"), null, null);
await WithUnitOfWorkAsync(async () =>
{
// Arrange
Expand All @@ -65,7 +69,8 @@ await WithUnitOfWorkAsync(async () =>
{
var orderGenerator = GetRequiredService<INewOrderGenerator>();

var createOrderLine = new CreateOrderLineInfoModel(OrderTestData.Product1Id, OrderTestData.ProductSku2Id, 1);
var createOrderLine =
new CreateOrderLineInfoModel(OrderTestData.Product1Id, OrderTestData.ProductSku2Id, 1);
var createOrderInfoModel = new CreateOrderInfoModel(OrderTestData.Store1Id, null,
new List<CreateOrderLineInfoModel>
{
Expand All @@ -81,13 +86,23 @@ await WithUnitOfWorkAsync(async () =>
new ProductEto
{
Id = OrderTestData.Product1Id,
ProductSkus = new List<ProductSkuEto>{ prodoctSku }
ProductSkus = new List<ProductSkuEto> { prodoctSku }
}
}
};

order = await orderGenerator.GenerateAsync(Guid.NewGuid(), createOrderInfoModel, dic, new Dictionary<Guid, DateTime>());

if (throws)
{
await Should.ThrowAsync<OrderDoesNotMeetCouponUsageConditionException>(() =>
orderGenerator.GenerateAsync(Guid.NewGuid(), createOrderInfoModel, dic,
new Dictionary<Guid, DateTime>()));
return;
}
else
{
order = await orderGenerator.GenerateAsync(Guid.NewGuid(), createOrderInfoModel, dic,
new Dictionary<Guid, DateTime>());
}
});

//assert
Expand All @@ -98,9 +113,10 @@ await WithUnitOfWorkAsync(async () =>
order.ActualTotalPrice.ShouldBe(orderLine2ExpectedPrice);
order.TotalDiscount.ShouldBe(order.TotalPrice - order.ActualTotalPrice);
order.OrderDiscounts.Count.ShouldBe(1);
var orderDiscount = order.OrderDiscounts.SingleOrDefault(x => x.OrderId == order.Id && x.OrderLineId == orderLine.Id && x.EffectGroup == "Coupon");
var orderDiscount = order.OrderDiscounts.SingleOrDefault(x =>
x.OrderId == order.Id && x.OrderLineId == orderLine.Id && x.EffectGroup == "Coupon");
orderDiscount.ShouldNotBeNull();
orderDiscount.DiscountedAmount.ShouldBe(discountAmount);
}

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<PackageReference Include="EasyAbp.PaymentService.WeChatPay.Web" Version="$(EasyAbpPaymentServiceModuleVersion)" />
<PackageReference Include="EasyAbp.PaymentService.Prepayment.Web" Version="$(EasyAbpPaymentServiceModuleVersion)" />
<PackageReference Include="EasyAbp.BookingService.Web" Version="$(EasyAbpBookingServiceModuleVersion)" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite" Version="3.2.0" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite" Version="3.3.2" />
<PackageReference Include="Volo.Abp.Autofac" Version="$(AbpVersion)" />
<PackageReference Include="Volo.Abp.AspNetCore.Authentication.JwtBearer" Version="$(AbpVersion)" />
<PackageReference Include="Volo.Abp.AspNetCore.Serilog" Version="$(AbpVersion)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"name": "my-app",
"private": true,
"dependencies": {
"@abp/aspnetcore.mvc.ui.theme.leptonxlite": "~3.2.0"
"@abp/aspnetcore.mvc.ui.theme.leptonxlite": "~3.3.2"
}
}
Loading

0 comments on commit b791b76

Please sign in to comment.