Skip to content

canro91/VSMoqSnippets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Visual Studio Snippets for Moq

This repo contains Moq snippets for Visual Studio

Installation

To import this snippet into Visual Studio, follow these steps

  1. Download MoqCodeSnippets.snippet
  2. Head to "Tools" > "Code Snippets Manager"
  3. Click "Import" in the lower left corner
  4. Find the snippet file you downloaded on step 1. and click "Open"
  5. Choose "My Code Snippets" as the location for the snippets
  6. Click "Finish" and "Ok"

Usage

Create a Mock

mn to create a Mock

Setup and Return

mr to Setup/Return

Setup and ThrowsException

mt to Setup/ThrowsException

Snippets

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

About

Visual Studio snippets for Moq

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published