dotnet-testing-datetime-testing-timeprovider
使用 Microsoft.Bcl.TimeProvider 測試時間相依邏輯的完整指南。當使用者需要測試與日期時間相關的程式碼(如營業時間判斷、快取過期、排程任務、Token 有效期限)、詢問如何讓 DateTime.Now 可測試、或需要在測試中控制時間流逝時,請使用此技能。涵蓋 TimeProvider 抽象化、FakeTimeProvider 時間控制(凍結、快轉、倒轉)、以及 AutoFixture 整合。
Installation
Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.
View source ↗GuidesSkill instructions
Features and purpose
使用 Microsoft.Bcl.TimeProvider 測試時間相依邏輯的完整指南。當使用者需要測試與日期時間相關的程式碼(如營業時間判斷、快取過期、排程任務、Token 有效期限)、詢問如何讓 DateTime.Now 可測試、或需要在測試中控制時間流逝時,請使用此技能。涵蓋 TimeProvider 抽象化、FakeTimeProvider 時間控制(凍結、快轉、倒轉)、以及 AutoFixture 整合。
Quick start
Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.
Guides ↗Examples
Read the usage examples in the source repository.
View source ↗Source history
- Indexed on
- 2026-01-25
- Index updated
- 2026-03-06
- Branch
- main
Index and sync dates describe this directory. View the source repository for code history.
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!