Skip to content

Instantly share code, notes, and snippets.

@ghyston
Created September 4, 2018 14:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ghyston/2fbd3dce3aae588a4f8d47bf34bee9ba to your computer and use it in GitHub Desktop.
Save ghyston/2fbd3dce3aae588a4f8d47bf34bee9ba to your computer and use it in GitHub Desktop.
Snippet for VS2017 to add mocking object properties faster.
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets
xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>Add Mock</Title>
<Author>Hyston</Author>
<Description>Add mock property.</Description>
<Shortcut>mock</Shortcut>
</Header>
<Snippet>
<Imports>
<Import>
<Namespace>Moq</Namespace>
</Import>
</Imports>
<Declarations>
<Literal>
<ID>MockedClass</ID>
<ToolTip>Replace with a class name, that should be mocked.</ToolTip>
<Default>Foo</Default>
</Literal>
</Declarations>
<Code Language="CSharp">
<![CDATA[public Mock<$MockedClass$> $MockedClass$Mock = new Mock<$MockedClass$>();]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment