Che cos'è moq?
Simula le dipendenze negli unit test utilizzando il framework Moq. Utilizzare quando: scrivere test unitari, creare test doppi per interfacce, verificare chiamate di metodi, simulare operazioni asincrone Fonte: stuartf303/sorcha.
Simula le dipendenze negli unit test utilizzando il framework Moq. Utilizzare quando: scrivere test unitari, creare test doppi per interfacce, verificare chiamate di metodi, simulare operazioni asincrone
Installa rapidamente la skill AI moq nel tuo ambiente di sviluppo tramite riga di comando
Fonte: stuartf303/sorcha.
Moq provides type-safe mocking for .NET unit tests. Sorcha uses Moq extensively across 30+ test projects to isolate components and verify interactions. The codebase favors constructor injection with mocks stored as private readonly fields.
| Mock | Create mock instance | new Mock () | | .Object | Get mock instance | mock.Object | | Mock.Of () | Quick mock for simple deps | Mock.Of >() | | Setup() | Configure behavior | .Setup(x => x.Method()) | | ReturnsAsync() | Async return value | .ReturnsAsync(result) | | Callback() | Capture arguments | .Callback ((arg) => captured = arg) |
| Verify() | Assert method called | .Verify(x => x.Method(), Times.Once) | | It.IsAny () | Match any argument | It.IsAny () | | It.Is () | Match with predicate | It.Is (x => x.Id == 1) |
Campi e comandi stabili per citazioni AI/ricerca.
npx skills add https://github.com/stuartf303/sorcha --skill moqSimula le dipendenze negli unit test utilizzando il framework Moq. Utilizzare quando: scrivere test unitari, creare test doppi per interfacce, verificare chiamate di metodi, simulare operazioni asincrone Fonte: stuartf303/sorcha.
Apri il tuo terminale o strumento da riga di comando (Terminal, iTerm, Windows Terminal, ecc.) Copia ed esegui questo comando: npx skills add https://github.com/stuartf303/sorcha --skill moq Dopo l'installazione, la skill verrà configurata automaticamente nel tuo ambiente AI di coding e sarà pronta all'uso in Claude Code, Cursor o OpenClaw
https://github.com/stuartf303/sorcha