Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

現在日時の生成にTimeProviderを利用する #862

Merged

Conversation

KentaHizume
Copy link
Contributor

対象

確認いただきたいポイント

  • Orderに対する実装
    • テスト用のプライベートコンストラクタを作成
  • BuyerIdFilterAttributeTestにおけるCookieの確認方法
    • 日付の文字列をAssert.Containsで確認
  • ConsoleAppHostedServiceに対する実装
    • DIコンテナにTimeProvider.Systemを登録

原因不明

  • BuyerIdFilterAttributeについて、Program.csでDIコンテナにTimeProviderを登録していない状態でも、問題なくCookieに日時が登録される。デバッグすると、BuyerIdFilterAttributeのコンストラクタに{System.TimeProvider.SystemTimeProvider}が引き渡されているので問題なく動作しているようだが、理由が特定できない。

@KentaHizume KentaHizume added target: Dressca サンプルアプリケーションDresscaに関係がある target: ConsoleAppWithDI コンソールアプリケーションの要件別サンプルに関係がある labels Feb 27, 2024
@KentaHizume KentaHizume added this to the v0.8 milestone Feb 27, 2024
@KentaHizume KentaHizume self-assigned this Feb 27, 2024
@KentaHizume KentaHizume linked an issue Feb 27, 2024 that may be closed by this pull request
5 tasks
@tsuna-can-se tsuna-can-se modified the milestones: v0.8, v0.7 Feb 29, 2024
@tsuna-can-se tsuna-can-se changed the title 現在日時の生成にtime providerを利用する 現在日時の生成にTimeProviderを利用する Mar 1, 2024
Copy link

github-actions bot commented Mar 1, 2024

Test Result 📝

Test was a success.
Completed in 13639ms with 209 passed, 0 failed and 0 skipped.

Coverage 📐

Summary
Generated on: 03/01/2024 - 01:51:27
Coverage date: 03/01/2024 - 01:51:19 - 03/01/2024 - 01:51:23
Parser: MultiReport (3x Cobertura)
Assemblies: 6
Classes: 87
Files: 87
Line coverage: 59.8% (972 of 1623)
Covered lines: 972
Uncovered lines: 651
Coverable lines: 1623
Total lines: 5484
Branch coverage: 55.4% (173 of 312)
Covered branches: 173
Total branches: 312
Method coverage: Feature is only available for sponsors
Tag: 498_8105309295
Dressca.ApplicationCore - 85.5%
Name Line Branch
Dressca.ApplicationCore 85.5% 70.8%
Dressca.ApplicationCore.Accounting.Account 100% 100%
Dressca.ApplicationCore.Accounting.AccountItem 100%
Dressca.ApplicationCore.ApplicationCoreServicesExtensions 100%
Dressca.ApplicationCore.ApplicationService.AssetApplicationService 100% 70%
Dressca.ApplicationCore.ApplicationService.CatalogApplicationService 100% 50%
Dressca.ApplicationCore.ApplicationService.OrderApplicationService 100% 75%
Dressca.ApplicationCore.ApplicationService.ShoppingApplicationService 100% 78.5%
Dressca.ApplicationCore.ApplicationService.TransactionScopeManager 100% 100%
Dressca.ApplicationCore.Assets.Asset 82.6% 62.5%
Dressca.ApplicationCore.Assets.AssetNotFoundException 100%
Dressca.ApplicationCore.Assets.AssetTypes 100% 100%
Dressca.ApplicationCore.Baskets.Basket 100% 100%
Dressca.ApplicationCore.Baskets.BasketItem 86.3% 75%
Dressca.ApplicationCore.Baskets.CatalogItemNotExistingInBasketException 100%
Dressca.ApplicationCore.Catalog.CatalogBrand 90.9% 100%
Dressca.ApplicationCore.Catalog.CatalogCategory 90.9% 100%
Dressca.ApplicationCore.Catalog.CatalogDomainService 100% 66.6%
Dressca.ApplicationCore.Catalog.CatalogItem 53.7% 37.5%
Dressca.ApplicationCore.Catalog.CatalogItemAsset 73.6% 50%
Dressca.ApplicationCore.Catalog.CatalogItemNotExistingInRepositoryException 100%
Dressca.ApplicationCore.Events 100%
Dressca.ApplicationCore.Ordering.Address 61.1% 100%
Dressca.ApplicationCore.Ordering.CatalogItemOrdered 90% 100%
Dressca.ApplicationCore.Ordering.EmptyBasketOnCheckoutException 100%
Dressca.ApplicationCore.Ordering.NullBasketOnCheckoutException 100%
Dressca.ApplicationCore.Ordering.Order 86.6% 71.4%
Dressca.ApplicationCore.Ordering.OrderFactory 0%
Dressca.ApplicationCore.Ordering.OrderItem 75% 37.5%
Dressca.ApplicationCore.Ordering.OrderItemAsset 73.6% 66.6%
Dressca.ApplicationCore.Ordering.OrderNotFoundException 100%
Dressca.ApplicationCore.Ordering.ShipTo 58.3% 50%
Dressca.ApplicationCore.Resources.Messages 85.4% 100%
Dressca.Store.Assets.StaticFiles - 9.4%
Name Line Branch
Dressca.Store.Assets.StaticFiles 9.4% 0%
Dressca.Store.Assets.StaticFiles.Events 0%
Dressca.Store.Assets.StaticFiles.Resources.Messages 0% 0%
Dressca.Store.Assets.StaticFiles.StaticFileAssetStore 0% 0%
Dressca.Store.Assets.StaticFiles.StaticFileAssetStoreServicesExtension 100%
Dressca.SystemCommon - 87.3%
Name Line Branch
Dressca.SystemCommon 87.3% 90%
Dressca.SystemCommon.BusinessError 100% 83.3%
Dressca.SystemCommon.BusinessErrorCollection 88.8% 100%
Dressca.SystemCommon.BusinessException 93.7% 100%
Dressca.SystemCommon.ObjectExtensions 80% 50%
Dressca.SystemCommon.Resources.Messages 55.5% 100%
Dressca.SystemCommon.Text.Json.DefaultJsonSerializerOptions 100%
Dressca.Web - 29.2%
Name Line Branch
Dressca.Web 29.2% 25.4%
Dressca.Web.Assets.AssetExtensions 87.5% 50%
Dressca.Web.Baskets.BuyerIdFilterAttribute 55.8% 20%
Dressca.Web.Baskets.HttpContextExtensions 100% 100%
Dressca.Web.Controllers.ActionNameHelper 0% 0%
Dressca.Web.Controllers.ApiModel.FindCatalogItemsQuery 0%
Dressca.Web.Controllers.AssetsController 0% 0%
Dressca.Web.Controllers.BasketItemsController 0% 0%
Dressca.Web.Controllers.CatalogBrandsController 0% 0%
Dressca.Web.Controllers.CatalogCategoriesController 0% 0%
Dressca.Web.Controllers.CatalogItemsController 0% 0%
Dressca.Web.Controllers.ErrorController 0% 0%
Dressca.Web.Controllers.OrdersController 0% 0%
Dressca.Web.Events 100%
Dressca.Web.HealthChecks.HealthCheckDescriptionProvider 7.8% 0%
Dressca.Web.Mapper.BasketItemMapper 0% 0%
Dressca.Web.Mapper.BasketMapper 0% 0%
Dressca.Web.Mapper.CatalogBrandMapper 0% 0%
Dressca.Web.Mapper.CatalogCategoryMapper 0% 0%
Dressca.Web.Mapper.CatalogItemMapper 0% 0%
Dressca.Web.Mapper.DtoMapperServicesExtension 100%
Dressca.Web.Mapper.OrderMapper 0% 0%
Dressca.Web.Resources.Messages 37% 100%
Dressca.Web.Runtime.BusinessExceptionDevelopmentFilter 100% 50%
Dressca.Web.Runtime.BusinessExceptionFilter 100% 50%
Dressca.Web.Runtime.BusinessExceptionFilterBase 100% 83.3%
Program 75% 66.6%
Dressca.Web.Dto - 0%
Name Line Branch
Dressca.Web.Dto 0% 0%
Dressca.Web.Dto.Accounting.AccountResponse 0%
Dressca.Web.Dto.Baskets.BasketItemResponse 0%
Dressca.Web.Dto.Baskets.BasketResponse 0%
Dressca.Web.Dto.Baskets.PostBasketItemsRequest 0%
Dressca.Web.Dto.Baskets.PutBasketItemsRequest 0%
Dressca.Web.Dto.Catalog.CatalogBrandResponse 0%
Dressca.Web.Dto.Catalog.CatalogCategoryResponse 0%
Dressca.Web.Dto.Catalog.CatalogItemResponse 0%
Dressca.Web.Dto.Catalog.CatalogItemSummaryResponse 0%
Dressca.Web.Dto.Ordering.OrderItemResponse 0%
Dressca.Web.Dto.Ordering.OrderResponse 0%
Dressca.Web.Dto.Ordering.PostOrderRequest 0%
Dressca.Web.Dto.PagedList`1 0% 0%
Maris.Logging.Testing - 94.2%
Name Line Branch
Maris.Logging.Testing 94.2% 100%
Maris.Logging.Testing.Xunit.TestLoggerManager 100% 100%
Maris.Logging.Testing.Xunit.XunitLogger 76.4% 100%
Maris.Logging.Testing.Xunit.XunitLoggerProvider 100% 100%
Microsoft.Extensions.DependencyInjection.TestLoggerServiceCollectionExtensi
ons
100%
Microsoft.Extensions.Logging.FakeLoggingBuilderExtensions 100%
Microsoft.Extensions.Logging.XunitLoggingBuilderExtensions 100%

@tsuna-can-se tsuna-can-se merged commit f14959a into main Mar 1, 2024
7 checks passed
@tsuna-can-se tsuna-can-se deleted the feature/現在日時の生成にTimeProviderを利用する branch March 1, 2024 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
target: ConsoleAppWithDI コンソールアプリケーションの要件別サンプルに関係がある target: Dressca サンプルアプリケーションDresscaに関係がある
Projects
None yet
Development

Successfully merging this pull request may close these issues.

現在日時の生成にTimeProviderを利用する
2 participants