コード例 #1
0
        /// <summary>
        /// Set the service_name to send to coveralls
        /// </summary>
        /// <param name="settings">The settings</param>
        /// <param name="serviceName">the service_name to send to coveralls</param>
        /// <returns>The <see cref="CoverallsSettingsExtensions"/> instance so that multiple calls can be chained</returns>
        public static CoverallsSettings WithServiceName(this CoverallsSettings settings, string serviceName)
        {
            if (settings == null)
            {
                throw new ArgumentNullException(nameof(settings));
            }

            settings.ServiceName = serviceName;

            return(settings);
        }
コード例 #2
0
        /// <summary>
        /// Set the Repo Token to use when sending coverage to coveralls
        /// </summary>
        /// <param name="settings">The settings</param>
        /// <param name="repoToken">the Repo Token to use when sending coverage to coveralls</param>
        /// <returns>The <see cref="CoverallsSettingsExtensions"/> instance so that multiple calls can be chained</returns>
        public static CoverallsSettings WithRepoToken(this CoverallsSettings settings, string repoToken)
        {
            if (settings == null)
            {
                throw new ArgumentNullException(nameof(settings));
            }

            settings.RepoToken = repoToken;

            return(settings);
        }
コード例 #3
0
        /// <summary>
        /// Set the root path to the git repo
        /// </summary>
        /// <param name="settings">The settings</param>
        /// <param name="rootPath">the path to the git repo</param>
        /// <returns>The <see cref="CoverallsSettingsExtensions"/> instance so that multiple calls can be chained</returns>
        public static CoverallsSettings WithRootPath(this CoverallsSettings settings, string rootPath)
        {
            if (settings == null)
            {
                throw new ArgumentNullException(nameof(settings));
            }

            settings.RootPath = rootPath;

            return(settings);
        }
コード例 #4
0
        /// <summary>
        /// Set the git branch to send to coveralls
        /// </summary>
        /// <param name="settings">The settings</param>
        /// <param name="branch">The git branch to send to coveralls</param>
        /// <returns>The <see cref="CoverallsSettingsExtensions"/> instance so that multiple calls can be chained</returns>
        public static CoverallsSettings WithBranch(this CoverallsSettings settings, string branch)
        {
            if (settings == null)
            {
                throw new ArgumentNullException(nameof(settings));
            }

            settings.Branch = branch;

            return(settings);
        }
コード例 #5
0
        /// <summary>
        /// Set the git commit message to use when sending coverage to coveralls
        /// </summary>
        /// <param name="settings">The settings</param>
        /// <param name="hash">the git commit hash to use when sending coverage to coverallss</param>
        ///
        /// <param name="message">the git commit message to use when sending coverage to coverallss</param>
        /// <returns>The <see cref="CoverallsSettingsExtensions"/> instance so that multiple calls can be chained</returns>
        public static CoverallsSettings WithCommit(this CoverallsSettings settings, string hash, string message)
        {
            if (settings == null)
            {
                throw new ArgumentNullException(nameof(settings));
            }

            settings.CommitHash    = hash;
            settings.CommitMessage = message;

            return(settings);
        }
コード例 #6
0
        /// <summary>
        /// Populate the Coveralls Settings with information for publishing coverage from Travis CI
        /// </summary>
        /// <param name="settings"></param>
        /// <param name="isTravisPro"></param>
        public static CoverallsSettings UseTravisDefaults(this CoverallsSettings settings, bool isTravisPro = false)
        {
            if (Environment.GetEnvironmentVariable("TRAVIS") != "true")
            {
                throw new InvalidOperationException("Not running on travis-ci");
            }

            settings.WithServiceName(isTravisPro ? "travis-pro" : "travvis-ci");
            settings.WithServiceJobId(Environment.GetEnvironmentVariable("TRAVIS_JOB_ID"));

            return(settings);
        }
コード例 #7
0
        /// <summary>
        /// Set git remote details
        /// </summary>
        /// <param name="settings">The settings</param>
        /// <param name="name">The name of the git remote</param>
        /// <param name="url">The URL of the git remote</param>
        /// <returns>The <see cref="CoverallsSettingsExtensions"/> instance so that multiple calls can be chained</returns>
        public static CoverallsSettings WithRemote(this CoverallsSettings settings, string name, string url)
        {
            if (settings == null)
            {
                throw new ArgumentNullException(nameof(settings));
            }

            settings.Remote    = name;
            settings.RemoteUrl = url;

            return(settings);
        }
コード例 #8
0
        /// <summary>
        /// Set the comitter etails
        /// </summary>
        /// <param name="settings">The settings</param>
        /// <param name="name">The name of the committer</param>
        /// <param name="email">The email address of the committer</param>
        /// <returns>The <see cref="CoverallsSettingsExtensions"/> instance so that multiple calls can be chained</returns>
        public static CoverallsSettings WithCommitter(this CoverallsSettings settings, string name, string email)
        {
            if (settings == null)
            {
                throw new ArgumentNullException(nameof(settings));
            }

            settings.CommitterName  = name;
            settings.CommitterEmail = email;

            return(settings);
        }
コード例 #9
0
 /// <summary>
 /// Set settings for coveralls report generation
 /// </summary>
 /// <param name="settings">The settings.</param>
 /// <param name="coveralls">Settings for coveralls</param>
 /// <returns>The <see cref="MiniCoverSettings"/> instance so that multiple calls can be chained</returns>
 public static MiniCoverSettings WithCoverallsSettings(this MiniCoverSettings settings, CoverallsSettings coveralls) =>
 settings.WithCoverallsSettings((Action <CoverallsSettings>)null);