This repo contains Moq snippets for Visual Studio
To import this snippet into Visual Studio, follow these steps
- Download
MoqCodeSnippets.snippet
- Head to "Tools" > "Code Snippets Manager"
- Click "Import" in the lower left corner
- Find the snippet file you downloaded on step 1. and click "Open"
- Choose "My Code Snippets" as the location for the snippets
- Click "Finish" and "Ok"
Trigger | Content |
---|---|
mn→ |
Create a new Mock |
mr→ |
Setup and Return with a mock |
mra→ |
Setup and ReturnAsync with a mock |
mt→ |
Setup and ThrowsException with a mock |
mta→ |
Setup and ThrowsExceptionAsync with a mock |
mi→ |
Create It.Is parameter inside a mock |
mia→ |
Create It.IsAny parameter inside a mock |
mv→ |
Verify a mock was called with Times.Exactly |