/// <summary>Builds the value parameter.</summary>
    /// <param name="typeMember">The type member.</param>
    /// <param name="getter">The getter.</param>
    /// <param name="setter">The setter.</param>
    private void BuildValueParameter([NotNull] ITypeMemberDeclaration typeMember, [NotNull] IAccessorDeclaration getter, [CanBeNull] IAccessorDeclaration setter)
    {
      if (typeMember == null)
      {
        throw new ArgumentNullException("typeMember");
      }

      if (getter == null)
      {
        throw new ArgumentNullException("getter");
      }

      var returnType = getter.DeclaredElement.ReturnType;
      if (!returnType.IsReferenceType())
      {
        return;
      }

      var expectsAssertion = false;
      var assertionCode = string.Empty;
      var appliedAttribute = this.AppliedReturn;
      var expectedAttribute = this.ExpectedReturn;

      if (appliedAttribute == CodeAnnotationAttribute.CanBeNull)
      {
      }
      else if (appliedAttribute == CodeAnnotationAttribute.NotNull || expectedAttribute == CodeAnnotationAttribute.NotNull)
      {
        if (this.GenerateAssertions)
        {
          if (setter != null && setter.Body != null)
          {
            assertionCode = this.GetCode();
            if (!string.IsNullOrEmpty(assertionCode))
            {
              assertionCode = string.Format(assertionCode, "value").Trim();
              expectsAssertion = true;
            }
          }
        }
      }

      var descriptor = new ParameterDescriptor(expectedAttribute, appliedAttribute, expectsAssertion, assertionCode);
      this.parameters.Add(descriptor);
    }
    /// <summary>Builds the parameters.</summary>
    /// <param name="parametersOwner">The method.</param>
    /// <param name="isAbstract">if set to <c>true</c> [is abstract].</param>
    private void BuildParameters(IParametersOwnerDeclaration parametersOwner, bool isAbstract)
    {
      foreach (var parameter in parametersOwner.ParameterDeclarations)
      {
        if (!parameter.Type.IsReferenceType())
        {
          continue;
        }

        var expectsAssertion = false;
        var assertionCode = string.Empty;
        var appliedAttribute = this.CodeAnnotation.GetAnnotation(parameter);
        var expectedAttribute = CodeAnnotationAttribute.NotNull;

        if (appliedAttribute == CodeAnnotationAttribute.CanBeNull)
        {
          expectedAttribute = CodeAnnotationAttribute.CanBeNull;
        }
        else if (parameter.DeclaredElement != null && parameter.DeclaredElement.Kind == ParameterKind.OUTPUT)
        {
          appliedAttribute = CodeAnnotationAttribute.Undefined;
          expectedAttribute = CodeAnnotationAttribute.Undefined;
        }
        else
        {
          if (this.GenerateAssertions)
          {
            assertionCode = this.GetCode();
            if (!string.IsNullOrEmpty(assertionCode))
            {
              assertionCode = string.Format(assertionCode, parameter.DeclaredName).Trim();
              expectsAssertion = true;
            }
          }
        }

        if (isAbstract)
        {
          expectsAssertion = false;
        }

        var descriptor = new ParameterDescriptor(parameter, expectedAttribute, appliedAttribute, expectsAssertion, assertionCode);
        this.parameters.Add(descriptor);
      }
    }