<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets  xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <Title>ArgumentException for empty string and null string</Title>
      <Shortcut>exceptionOnEmptyAndNullString</Shortcut>
      <Description>Code snippet for an automatically implemented ArgumentException and ArgumentNullException</Description>
      <Author>Capgemini - Alexander Schunk</Author>
      <SnippetTypes>
        <SnippetType>Expansion</SnippetType>
      </SnippetTypes>
    </Header>
    <Snippet>
      <Declarations>
        <Literal>
          <ID>argumentName</ID>
          <ToolTip>Argument name</ToolTip>
          <Default>arg</Default>
        </Literal>
      </Declarations>
      <Code Language="csharp">
        <![CDATA[
            if ($argumentName$ == null)
                throw new ArgumentNullException(nameof($argumentName$));

            if ($argumentName$.Length == 0)
                throw new ArgumentException("The parameter is an empty string" , nameof($argumentName$));
            $end$]]>
      </Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>