mirror of https://github.com/EasyAbp/EShop.git
13 changed files with 553 additions and 27 deletions
@ -0,0 +1,143 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using EasyAbp.EShop.Orders; |
|||
using EasyAbp.EShop.Orders.Booking.Authorization; |
|||
using EasyAbp.EShop.Orders.Orders; |
|||
using EasyAbp.EShop.Orders.Orders.Dtos; |
|||
using EasyAbp.EShop.Plugins.Booking.ProductAssetCategories; |
|||
using EasyAbp.EShop.Plugins.Booking.ProductAssets; |
|||
using EasyAbp.EShop.Products.Products.Dtos; |
|||
using Microsoft.AspNetCore.Authorization; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Shouldly; |
|||
using Volo.Abp.Data; |
|||
using Volo.Abp.Security.Claims; |
|||
using Xunit; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.Authorization; |
|||
|
|||
public class BookingOrderCreationAuthorizationHandlersTests : BookingApplicationTestBase |
|||
{ |
|||
[Fact] |
|||
public async Task Should_Not_Has_Failed_If_Valid() |
|||
{ |
|||
var handler = ServiceProvider.GetRequiredService<BookingOrderCreationAuthorizationHandler>(); |
|||
|
|||
var context = await CreateAuthorizationHandlerContextAsync(); |
|||
|
|||
await handler.HandleAsync(context); |
|||
|
|||
context.HasFailed.ShouldBeFalse(); |
|||
} |
|||
|
|||
[Fact] |
|||
public async Task Should_Failed_If_ProductAsset_Mapping_Not_Exists() |
|||
{ |
|||
var productAssetRepository = ServiceProvider.GetRequiredService<IProductAssetRepository>(); |
|||
|
|||
var productAsset = await productAssetRepository.GetAsync(x => |
|||
x.AssetId == BookingTestConsts.Asset1Id && x.ProductId == BookingTestConsts.BookingProduct1Id); |
|||
|
|||
await productAssetRepository.DeleteAsync(productAsset, true); |
|||
|
|||
var handler = ServiceProvider.GetRequiredService<BookingOrderCreationAuthorizationHandler>(); |
|||
|
|||
var context = await CreateAuthorizationHandlerContextAsync(); |
|||
|
|||
await handler.HandleAsync(context); |
|||
|
|||
context.HasFailed.ShouldBeTrue(); |
|||
|
|||
await productAssetRepository.InsertAsync(productAsset, true); |
|||
} |
|||
|
|||
[Fact] |
|||
public async Task Should_Failed_If_ProductAssetCategory_Mapping_Not_Exists() |
|||
{ |
|||
var productAssetCategoryRepository = ServiceProvider.GetRequiredService<IProductAssetCategoryRepository>(); |
|||
|
|||
var productAsset = await productAssetCategoryRepository.GetAsync(x => |
|||
x.AssetCategoryId == BookingTestConsts.AssetCategory1Id && |
|||
x.ProductId == BookingTestConsts.BookingProduct1Id); |
|||
|
|||
await productAssetCategoryRepository.DeleteAsync(productAsset, true); |
|||
|
|||
var handler = ServiceProvider.GetRequiredService<BookingOrderCreationAuthorizationHandler>(); |
|||
|
|||
var context = await CreateAuthorizationHandlerContextAsync(); |
|||
|
|||
await handler.HandleAsync(context); |
|||
|
|||
context.HasFailed.ShouldBeTrue(); |
|||
|
|||
await productAssetCategoryRepository.InsertAsync(productAsset, true); |
|||
} |
|||
|
|||
private Task<AuthorizationHandlerContext> CreateAuthorizationHandlerContextAsync() |
|||
{ |
|||
var orderLine1 = new CreateOrderLineDto |
|||
{ |
|||
ProductId = BookingTestConsts.BookingProduct1Id, |
|||
ProductSkuId = BookingTestConsts.BookingProduct1Sku1Id, |
|||
Quantity = 1 |
|||
}; |
|||
|
|||
orderLine1.SetProperty(BookingOrderProperties.OrderLineBookingPeriodSchemeId, |
|||
BookingTestConsts.PeriodScheme1Id); |
|||
orderLine1.SetProperty(BookingOrderProperties.OrderLineBookingPeriodId, BookingTestConsts.Period1Id); |
|||
orderLine1.SetProperty(BookingOrderProperties.OrderLineBookingAssetId, BookingTestConsts.Asset1Id); |
|||
orderLine1.SetProperty(BookingOrderProperties.OrderLineBookingDate, BookingTestConsts.BookingDate); |
|||
orderLine1.SetProperty(BookingOrderProperties.OrderLineBookingStartingTime, |
|||
BookingTestConsts.Period1StartingTime); |
|||
orderLine1.SetProperty(BookingOrderProperties.OrderLineBookingDuration, BookingTestConsts.Period1Duration); |
|||
orderLine1.SetProperty(BookingOrderProperties.OrderLineBookingVolume, BookingTestConsts.Volume); |
|||
|
|||
var orderLine2 = new CreateOrderLineDto |
|||
{ |
|||
ProductId = BookingTestConsts.BookingProduct1Id, |
|||
ProductSkuId = BookingTestConsts.BookingProduct1Sku1Id, |
|||
Quantity = 1 |
|||
}; |
|||
|
|||
orderLine2.SetProperty(BookingOrderProperties.OrderLineBookingPeriodSchemeId, |
|||
BookingTestConsts.PeriodScheme1Id); |
|||
orderLine2.SetProperty(BookingOrderProperties.OrderLineBookingPeriodId, BookingTestConsts.Period1Id); |
|||
orderLine2.SetProperty(BookingOrderProperties.OrderLineBookingAssetCategoryId, |
|||
BookingTestConsts.AssetCategory1Id); |
|||
orderLine2.SetProperty(BookingOrderProperties.OrderLineBookingDate, BookingTestConsts.BookingDate); |
|||
orderLine2.SetProperty(BookingOrderProperties.OrderLineBookingStartingTime, |
|||
BookingTestConsts.Period1StartingTime); |
|||
orderLine2.SetProperty(BookingOrderProperties.OrderLineBookingDuration, BookingTestConsts.Period1Duration); |
|||
orderLine2.SetProperty(BookingOrderProperties.OrderLineBookingVolume, BookingTestConsts.Volume); |
|||
|
|||
var currentPrincipalAccessor = ServiceProvider.GetRequiredService<ICurrentPrincipalAccessor>(); |
|||
|
|||
return Task.FromResult(new AuthorizationHandlerContext( |
|||
new[] { new OrderOperationAuthorizationRequirement(OrderOperation.Creation) }, |
|||
currentPrincipalAccessor.Principal, |
|||
new OrderCreationResource |
|||
{ |
|||
Input = new CreateOrderDto |
|||
{ |
|||
StoreId = BookingTestConsts.Store1Id, |
|||
OrderLines = new List<CreateOrderLineDto> |
|||
{ |
|||
orderLine1, orderLine2 |
|||
} |
|||
}, |
|||
ProductDictionary = new Dictionary<Guid, ProductDto> |
|||
{ |
|||
{ |
|||
BookingTestConsts.BookingProduct1Id, |
|||
new ProductDto |
|||
{ |
|||
Id = BookingTestConsts.BookingProduct1Id, |
|||
StoreId = BookingTestConsts.Store1Id, |
|||
ProductGroupName = BookingTestConsts.BookingProductGroupName |
|||
} |
|||
} |
|||
} |
|||
})); |
|||
} |
|||
} |
|||
@ -0,0 +1,123 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using EasyAbp.EShop.Orders; |
|||
using EasyAbp.EShop.Orders.Orders.Dtos; |
|||
using EasyAbp.EShop.Payments.Booking.Authorization; |
|||
using EasyAbp.EShop.Payments.Payments; |
|||
using EasyAbp.EShop.Payments.Payments.Dtos; |
|||
using EasyAbp.EShop.Plugins.Booking.ProductAssets; |
|||
using Microsoft.AspNetCore.Authorization; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Shouldly; |
|||
using Volo.Abp.Data; |
|||
using Volo.Abp.Security.Claims; |
|||
using Xunit; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.Authorization; |
|||
|
|||
public class BookingPaymentCreationAuthorizationHandlersTests : BookingApplicationTestBase |
|||
{ |
|||
[Fact] |
|||
public async Task Should_Not_Has_Failed_If_Valid() |
|||
{ |
|||
var handler = ServiceProvider.GetRequiredService<BookingPaymentCreationAuthorizationHandler>(); |
|||
|
|||
var context = await CreateAuthorizationHandlerContextAsync(); |
|||
|
|||
await handler.HandleAsync(context); |
|||
|
|||
context.HasFailed.ShouldBeFalse(); |
|||
} |
|||
|
|||
[Fact] |
|||
public async Task Should_Failed_If_ProductAsset_Mapping_Not_Exists() |
|||
{ |
|||
var productAssetRepository = ServiceProvider.GetRequiredService<IProductAssetRepository>(); |
|||
|
|||
var productAsset = await productAssetRepository.GetAsync(x => |
|||
x.AssetId == BookingTestConsts.Asset1Id && x.ProductId == BookingTestConsts.BookingProduct1Id); |
|||
|
|||
await productAssetRepository.DeleteAsync(productAsset, true); |
|||
|
|||
var handler = ServiceProvider.GetRequiredService<BookingPaymentCreationAuthorizationHandler>(); |
|||
|
|||
var context = await CreateAuthorizationHandlerContextAsync(); |
|||
|
|||
await handler.HandleAsync(context); |
|||
|
|||
context.HasFailed.ShouldBeFalse(); |
|||
|
|||
await productAssetRepository.InsertAsync(productAsset, true); |
|||
} |
|||
|
|||
private Task<AuthorizationHandlerContext> CreateAuthorizationHandlerContextAsync() |
|||
{ |
|||
var orderLine1 = new OrderLineDto |
|||
{ |
|||
Id = BookingTestConsts.OrderLine1Id, |
|||
ProductId = BookingTestConsts.BookingProduct1Id, |
|||
ProductSkuId = BookingTestConsts.BookingProduct1Sku1Id, |
|||
Quantity = 1, |
|||
ExtraProperties = new ExtraPropertyDictionary() |
|||
}; |
|||
|
|||
orderLine1.SetProperty(BookingOrderProperties.OrderLineBookingPeriodSchemeId, |
|||
BookingTestConsts.PeriodScheme1Id); |
|||
orderLine1.SetProperty(BookingOrderProperties.OrderLineBookingPeriodId, BookingTestConsts.Period1Id); |
|||
orderLine1.SetProperty(BookingOrderProperties.OrderLineBookingAssetId, BookingTestConsts.Asset1Id); |
|||
orderLine1.SetProperty(BookingOrderProperties.OrderLineBookingDate, BookingTestConsts.BookingDate); |
|||
orderLine1.SetProperty(BookingOrderProperties.OrderLineBookingStartingTime, |
|||
BookingTestConsts.Period1StartingTime); |
|||
orderLine1.SetProperty(BookingOrderProperties.OrderLineBookingDuration, BookingTestConsts.Period1Duration); |
|||
orderLine1.SetProperty(BookingOrderProperties.OrderLineBookingVolume, BookingTestConsts.Volume); |
|||
|
|||
var orderLine2 = new OrderLineDto |
|||
{ |
|||
Id = BookingTestConsts.OrderLine2Id, |
|||
ProductId = BookingTestConsts.BookingProduct1Id, |
|||
ProductSkuId = BookingTestConsts.BookingProduct1Sku1Id, |
|||
Quantity = 1, |
|||
ExtraProperties = new ExtraPropertyDictionary() |
|||
}; |
|||
|
|||
orderLine2.SetProperty(BookingOrderProperties.OrderLineBookingPeriodSchemeId, |
|||
BookingTestConsts.PeriodScheme1Id); |
|||
orderLine2.SetProperty(BookingOrderProperties.OrderLineBookingPeriodId, BookingTestConsts.Period1Id); |
|||
orderLine2.SetProperty(BookingOrderProperties.OrderLineBookingAssetCategoryId, |
|||
BookingTestConsts.AssetCategory1Id); |
|||
orderLine2.SetProperty(BookingOrderProperties.OrderLineBookingDate, BookingTestConsts.BookingDate); |
|||
orderLine2.SetProperty(BookingOrderProperties.OrderLineBookingStartingTime, |
|||
BookingTestConsts.Period1StartingTime); |
|||
orderLine2.SetProperty(BookingOrderProperties.OrderLineBookingDuration, BookingTestConsts.Period1Duration); |
|||
orderLine2.SetProperty(BookingOrderProperties.OrderLineBookingVolume, BookingTestConsts.Volume); |
|||
|
|||
var currentPrincipalAccessor = ServiceProvider.GetRequiredService<ICurrentPrincipalAccessor>(); |
|||
|
|||
return Task.FromResult(new AuthorizationHandlerContext( |
|||
new[] { new PaymentOperationAuthorizationRequirement(PaymentOperation.Creation) }, |
|||
currentPrincipalAccessor.Principal, |
|||
new PaymentCreationResource |
|||
{ |
|||
Input = new CreatePaymentDto |
|||
{ |
|||
PaymentMethod = "Free", |
|||
OrderIds = new List<Guid> |
|||
{ |
|||
BookingTestConsts.Order1Id |
|||
} |
|||
}, |
|||
Orders = new List<OrderDto> |
|||
{ |
|||
new() |
|||
{ |
|||
Id = BookingTestConsts.Order1Id, |
|||
OrderLines = new List<OrderLineDto> |
|||
{ |
|||
orderLine1, orderLine2 |
|||
} |
|||
} |
|||
} |
|||
})); |
|||
} |
|||
} |
|||
@ -1,12 +1,121 @@ |
|||
using Volo.Abp.Modularity; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using EasyAbp.BookingService.AssetCategories; |
|||
using EasyAbp.BookingService.AssetCategories.Dtos; |
|||
using EasyAbp.BookingService.AssetOccupancies; |
|||
using EasyAbp.BookingService.Assets; |
|||
using EasyAbp.BookingService.Assets.Dtos; |
|||
using EasyAbp.BookingService.AssetSchedules; |
|||
using EasyAbp.BookingService.Dtos; |
|||
using EasyAbp.BookingService.PeriodSchemes; |
|||
using EasyAbp.BookingService.PeriodSchemes.Dtos; |
|||
using EasyAbp.EShop.Orders.Booking; |
|||
using EasyAbp.EShop.Orders.Booking.Authorization; |
|||
using EasyAbp.EShop.Orders.Orders; |
|||
using EasyAbp.EShop.Payments.Booking; |
|||
using EasyAbp.EShop.Payments.Booking.Authorization; |
|||
using EasyAbp.EShop.Products.ProductDetails; |
|||
using EasyAbp.EShop.Products.Products; |
|||
using EasyAbp.EShop.Products.Products.Dtos; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using NSubstitute; |
|||
using NSubstitute.ReturnsExtensions; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking; |
|||
|
|||
[DependsOn( |
|||
typeof(EShopOrdersBookingApplicationModule), |
|||
typeof(EShopPaymentsBookingApplicationModule), |
|||
typeof(EShopPluginsBookingApplicationModule), |
|||
typeof(BookingDomainTestModule) |
|||
)] |
|||
)] |
|||
public class BookingApplicationTestModule : AbpModule |
|||
{ |
|||
public override void PreConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
context.Services.AddTransient<BookingOrderCreationAuthorizationHandler>(); |
|||
context.Services.AddTransient<BookingPaymentCreationAuthorizationHandler>(); |
|||
} |
|||
|
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
var services = context.Services; |
|||
|
|||
var periodSchemeAppService = Substitute.For<IPeriodSchemeAppService>(); |
|||
services.AddTransient(_ => periodSchemeAppService); |
|||
periodSchemeAppService.GetAsync(BookingTestConsts.PeriodScheme1Id).Returns(new PeriodSchemeDto |
|||
{ |
|||
Id = BookingTestConsts.PeriodScheme1Id, |
|||
Name = "PeriodScheme1", |
|||
IsDefault = true, |
|||
Periods = new List<PeriodDto> |
|||
{ |
|||
new() |
|||
{ |
|||
Id = BookingTestConsts.Period1Id, |
|||
StartingTime = BookingTestConsts.Period1StartingTime, |
|||
Duration = BookingTestConsts.Period1Duration |
|||
} |
|||
} |
|||
}); |
|||
|
|||
var assetOccupancyAppService = Substitute.For<IAssetOccupancyAppService>(); |
|||
services.AddTransient(_ => assetOccupancyAppService); |
|||
assetOccupancyAppService.CheckBulkCreateAsync(null).ReturnsForAnyArgs(Task.CompletedTask); |
|||
|
|||
var productAppService = Substitute.For<IProductAppService>(); |
|||
services.AddTransient(_ => productAppService); |
|||
productAppService.GetAsync(BookingTestConsts.BookingProduct1Id).Returns(new ProductDto |
|||
{ |
|||
Id = BookingTestConsts.BookingProduct1Id, |
|||
StoreId = BookingTestConsts.Store1Id, |
|||
ProductGroupName = BookingTestConsts.BookingProductGroupName, |
|||
ProductSkus = new List<ProductSkuDto> |
|||
{ |
|||
new() |
|||
{ |
|||
Id = BookingTestConsts.BookingProduct1Sku1Id, |
|||
AttributeOptionIds = new List<Guid>(), |
|||
Currency = "USD", |
|||
OrderMinQuantity = 1, |
|||
OrderMaxQuantity = 2 |
|||
} |
|||
} |
|||
}); |
|||
|
|||
var assetAppService = Substitute.For<IAssetAppService>(); |
|||
services.AddTransient(_ => assetAppService); |
|||
assetAppService.GetAsync(BookingTestConsts.Asset1Id).Returns(new AssetDto |
|||
{ |
|||
Id = BookingTestConsts.Asset1Id, |
|||
Name = "Camera1", |
|||
AssetDefinitionName = "Camera", |
|||
AssetCategoryId = BookingTestConsts.AssetCategory1Id, |
|||
PeriodSchemeId = BookingTestConsts.PeriodScheme1Id, |
|||
DefaultPeriodUsable = PeriodUsable.Accept, |
|||
Volume = 1, |
|||
TimeInAdvance = new TimeInAdvanceDto |
|||
{ |
|||
MaxDaysInAdvance = 7, |
|||
MinDaysInAdvance = 1 |
|||
}, |
|||
}); |
|||
|
|||
var assetCategoryAppService = Substitute.For<IAssetCategoryAppService>(); |
|||
services.AddTransient(_ => assetCategoryAppService); |
|||
assetCategoryAppService.GetAsync(BookingTestConsts.AssetCategory1Id).Returns(new AssetCategoryDto |
|||
{ |
|||
Id = BookingTestConsts.AssetCategory1Id, |
|||
DisplayName = "Cameras" |
|||
}); |
|||
|
|||
var productDetailAppService = Substitute.For<IProductDetailAppService>(); |
|||
services.AddTransient(_ => productDetailAppService); |
|||
|
|||
var orderRepository = Substitute.For<IOrderRepository>(); |
|||
services.AddTransient(_ => orderRepository); |
|||
orderRepository.InsertAsync(null).ReturnsNullForAnyArgs(); |
|||
} |
|||
} |
|||
|
|||
@ -0,0 +1,20 @@ |
|||
using System.Linq; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Shouldly; |
|||
using Xunit; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.BookingProductGroupDefinitions; |
|||
|
|||
public class BookingProductGroupDefinitionTests : BookingApplicationTestBase |
|||
{ |
|||
[Fact] |
|||
public async Task Should_Match_Booking_Product() |
|||
{ |
|||
var definitionAppService = ServiceProvider.GetRequiredService<IBookingProductGroupDefinitionAppService>(); |
|||
|
|||
var productGroupNames = (await definitionAppService.GetListAsync()).Items.Select(x => x.ProductGroupName); |
|||
|
|||
productGroupNames.ShouldContain(BookingTestConsts.BookingProductGroupName); |
|||
} |
|||
} |
|||
@ -0,0 +1,66 @@ |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using EasyAbp.EShop.Orders; |
|||
using EasyAbp.EShop.Orders.Orders; |
|||
using EasyAbp.EShop.Orders.Orders.Dtos; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Shouldly; |
|||
using Volo.Abp.Data; |
|||
using Xunit; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.Orders; |
|||
|
|||
public class BookingOrderCreationTests : BookingApplicationTestBase |
|||
{ |
|||
[Fact] |
|||
public async Task Should_Override_Booking_Price() |
|||
{ |
|||
var orderAppService = ServiceProvider.GetRequiredService<IOrderAppService>(); |
|||
|
|||
var orderLine1 = new CreateOrderLineDto |
|||
{ |
|||
ProductId = BookingTestConsts.BookingProduct1Id, |
|||
ProductSkuId = BookingTestConsts.BookingProduct1Sku1Id, |
|||
Quantity = 1 |
|||
}; |
|||
|
|||
orderLine1.SetProperty(BookingOrderProperties.OrderLineBookingPeriodSchemeId, |
|||
BookingTestConsts.PeriodScheme1Id); |
|||
orderLine1.SetProperty(BookingOrderProperties.OrderLineBookingPeriodId, BookingTestConsts.Period1Id); |
|||
orderLine1.SetProperty(BookingOrderProperties.OrderLineBookingAssetId, BookingTestConsts.Asset1Id); |
|||
orderLine1.SetProperty(BookingOrderProperties.OrderLineBookingDate, BookingTestConsts.BookingDate); |
|||
orderLine1.SetProperty(BookingOrderProperties.OrderLineBookingStartingTime, |
|||
BookingTestConsts.Period1StartingTime); |
|||
orderLine1.SetProperty(BookingOrderProperties.OrderLineBookingDuration, BookingTestConsts.Period1Duration); |
|||
orderLine1.SetProperty(BookingOrderProperties.OrderLineBookingVolume, BookingTestConsts.Volume); |
|||
|
|||
var orderLine2 = new CreateOrderLineDto |
|||
{ |
|||
ProductId = BookingTestConsts.BookingProduct1Id, |
|||
ProductSkuId = BookingTestConsts.BookingProduct1Sku1Id, |
|||
Quantity = 1 |
|||
}; |
|||
|
|||
orderLine2.SetProperty(BookingOrderProperties.OrderLineBookingPeriodSchemeId, |
|||
BookingTestConsts.PeriodScheme1Id); |
|||
orderLine2.SetProperty(BookingOrderProperties.OrderLineBookingPeriodId, BookingTestConsts.Period1Id); |
|||
orderLine2.SetProperty(BookingOrderProperties.OrderLineBookingAssetCategoryId, |
|||
BookingTestConsts.AssetCategory1Id); |
|||
orderLine2.SetProperty(BookingOrderProperties.OrderLineBookingDate, BookingTestConsts.BookingDate); |
|||
orderLine2.SetProperty(BookingOrderProperties.OrderLineBookingStartingTime, |
|||
BookingTestConsts.Period1StartingTime); |
|||
orderLine2.SetProperty(BookingOrderProperties.OrderLineBookingDuration, BookingTestConsts.Period1Duration); |
|||
orderLine2.SetProperty(BookingOrderProperties.OrderLineBookingVolume, BookingTestConsts.Volume); |
|||
|
|||
var order = await orderAppService.CreateAsync(new CreateOrderDto |
|||
{ |
|||
StoreId = BookingTestConsts.Store1Id, |
|||
OrderLines = new List<CreateOrderLineDto> |
|||
{ |
|||
orderLine1, orderLine2 |
|||
} |
|||
}); |
|||
|
|||
order.ActualTotalPrice.ShouldBe(15m); |
|||
} |
|||
} |
|||
@ -0,0 +1,36 @@ |
|||
using System; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking; |
|||
|
|||
public static class BookingTestConsts |
|||
{ |
|||
public static string BookingProductGroupName { get; } = "CameraBooking"; |
|||
|
|||
public static Guid Store1Id { get; } = Guid.NewGuid(); |
|||
|
|||
public static Guid Order1Id { get; } = Guid.NewGuid(); |
|||
|
|||
public static Guid OrderLine1Id { get; } = Guid.NewGuid(); |
|||
|
|||
public static Guid OrderLine2Id { get; } = Guid.NewGuid(); |
|||
|
|||
public static Guid BookingProduct1Id { get; } = Guid.NewGuid(); |
|||
|
|||
public static Guid BookingProduct1Sku1Id { get; } = Guid.NewGuid(); |
|||
|
|||
public static Guid Asset1Id { get; } = Guid.NewGuid(); |
|||
|
|||
public static Guid AssetCategory1Id { get; } = Guid.NewGuid(); |
|||
|
|||
public static Guid PeriodScheme1Id { get; } = Guid.NewGuid(); |
|||
|
|||
public static Guid Period1Id { get; } = Guid.NewGuid(); |
|||
|
|||
public static DateTime BookingDate { get; } = DateTime.Today.AddDays(1); |
|||
|
|||
public static TimeSpan Period1StartingTime { get; } = TimeSpan.FromHours(8); // from 8:00
|
|||
|
|||
public static TimeSpan Period1Duration { get; } = TimeSpan.FromHours(2); // to 10:00 (8:00 + 2h)
|
|||
|
|||
public static int Volume { get; } = 1; |
|||
} |
|||
Loading…
Reference in new issue