public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (int)Kind;
         hashCode = (hashCode * 397) ^ (TargetFrameworkMoniker != null ? TargetFrameworkMoniker.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (OutputAssemblyPath != null ? OutputAssemblyPath.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (DefaultNamespace != null ? DefaultNamespace.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (SpecFlowPackage != null ? SpecFlowPackage.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (SpecFlowConfigFilePath != null ? SpecFlowConfigFilePath.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (int)SpecFlowProjectTraits;
         return(hashCode);
     }
 }
Example #2
0
        private string CustomValidate()
        {
            var errors = new List <string>();

            if (PublicKeyPath != null && !File.Exists(PublicKeyPath))
            {
                errors.Add($"Public key file '{PublicKeyPath}' doesn't exists");
            }

            if (PublicKeyPath == null && PublicKey == null)
            {
                errors.Add("Public key should be specified in key or key-path parameter");
            }

            if (PublicKeyPath != null && PublicKey != null)
            {
                errors.Add("Source of the public key should be specified in key or key-path parameter");
            }

            if (EncryptionTargetPath != null && !PathExists(EncryptionTargetPath))
            {
                errors.Add($"Target '{EncryptionTargetPath}' doesn't exists");
            }

            if (OutputAssemblyPath != null)
            {
                if (!Directory.Exists(Path.GetDirectoryName(OutputAssemblyPath) ?? ""))
                {
                    errors.Add($"Output directory '{OutputAssemblyPath}' doesn't exist");
                }

                if (!OutputAssemblyPath.ToLowerInvariant().EndsWith(".exe"))
                {
                    errors.Add($"Output assembly path `{OutputAssemblyPath}` should point to executable with extension 'exe'");
                }
            }

            if (ContentVersion != null && !Regex.IsMatch(ContentVersion, @"^(\d\.){3}\d$"))
            {
                errors.Add("Content version parameter should be in '1.1.1.1' format");
            }

            return(errors.Any() ? string.Join(Environment.NewLine, errors) : null);
        }
Example #3
0
        private string CustomValidate()
        {
            var errors = new List <string>();

            if (PublicKeyPath != null && !File.Exists(PublicKeyPath))
            {
                errors.Add("Public key file doesn't exists");
            }

            if (PublicKeyPath == null && PublicKey == null)
            {
                errors.Add("Public key should be specified in key or key-path parameter");
            }

            if (PublicKeyPath != null && PublicKey != null)
            {
                errors.Add("Source of the public key should be specified in key or key-path parameter");
            }

            if (EncryptionTargetPath != null && !PathExists(EncryptionTargetPath))
            {
                errors.Add("Target doesn't exists");
            }

            if (OutputAssemblyPath != null)
            {
                if (!Directory.Exists(Path.GetDirectoryName(OutputAssemblyPath) ?? ""))
                {
                    errors.Add("Output directory doesn't exist");
                }

                if (!OutputAssemblyPath.ToLowerInvariant().EndsWith(".exe"))
                {
                    errors.Add("Output assembly path should point to executable with extension 'exe'");
                }
            }

            return(errors.Any() ? string.Join(Environment.NewLine, errors) : null);
        }