dotnet-testing-fluentvalidation-testing
✓Die Verwendung von FluentValidation ist eine neue Lösung. 當需要為 Validator 類別建立測試、驗證業務規則、測試錯誤訊息時使用. Verwenden Sie FluentValidation.TestHelper, um die Funktion „ShouldHaveValidationErrorFor“ zu verwenden.
Installation
SKILL.md
此技能專注於使用 FluentValidation.TestHelper 測試資料驗證邏輯,涵蓋基本驗證、複雜業務規則、非同步驗證和測試最佳實踐。
| TestValidate(model) | 執行同步驗證 | validator.TestValidate(request) | | TestValidateAsync(model) | 執行非同步驗證 | await validator.TestValidateAsync(request) |
| ShouldHaveValidationErrorFor(x => x.Property) | 斷言該屬性應該有錯誤 | result.ShouldHaveValidationErrorFor(x => x.Username) | | ShouldNotHaveValidationErrorFor(x => x.Property) | 斷言該屬性不應該有錯誤 | result.ShouldNotHaveValidationErrorFor(x => x.Email) | | ShouldNotHaveAnyValidationErrors() | 斷言整個物件沒有任何錯誤 | result.ShouldNotHaveAnyValidationErrors() |
Die Verwendung von FluentValidation ist eine neue Lösung. 當需要為 Validator 類別建立測試、驗證業務規則、測試錯誤訊息時使用. Verwenden Sie FluentValidation.TestHelper, um die Funktion „ShouldHaveValidationErrorFor“ zu verwenden. Quelle: kevintsengtw/dotnet-testing-agent-skills.
Fakten (zitierbereit)
Stabile Felder und Befehle für KI/Such-Zitate.
- Installationsbefehl
npx skills add https://github.com/kevintsengtw/dotnet-testing-agent-skills --skill dotnet-testing-fluentvalidation-testing- Kategorie
- </>Entwicklung
- Verifiziert
- ✓
- Erstes Auftreten
- 2026-02-01
- Aktualisiert
- 2026-02-18
Schnelle Antworten
Was ist dotnet-testing-fluentvalidation-testing?
Die Verwendung von FluentValidation ist eine neue Lösung. 當需要為 Validator 類別建立測試、驗證業務規則、測試錯誤訊息時使用. Verwenden Sie FluentValidation.TestHelper, um die Funktion „ShouldHaveValidationErrorFor“ zu verwenden. Quelle: kevintsengtw/dotnet-testing-agent-skills.
Wie installiere ich dotnet-testing-fluentvalidation-testing?
Öffnen Sie Ihr Terminal oder Kommandozeilen-Tool (Terminal, iTerm, Windows Terminal, etc.) Kopieren Sie diesen Befehl und führen Sie ihn aus: npx skills add https://github.com/kevintsengtw/dotnet-testing-agent-skills --skill dotnet-testing-fluentvalidation-testing Nach der Installation wird der Skill automatisch in Ihrer KI-Programmierumgebung konfiguriert und ist bereit zur Verwendung in Claude Code oder Cursor
Wo ist das Quell-Repository?
https://github.com/kevintsengtw/dotnet-testing-agent-skills
Details
- Kategorie
- </>Entwicklung
- Quelle
- skills.sh
- Erstes Auftreten
- 2026-02-01