Click here to Skip to main content
15,896,154 members
Articles / Web Development / ASP.NET

Secrets for Setting Up Continuous Integration

Rate me:
Please Sign up or sign in to vote.
2.88/5 (7 votes)
23 Feb 2009CPOL5 min read 65.7K   54   41  
A few simple tips that should help when you are considering setting up CI
using System;

namespace Agile.Common
{
    /// <summary>
    /// Implemented methods that disappeared from enterprise lib in V2.0
    /// </summary>
    public sealed class ArgumentValidation
    {
        /// <summary>
        /// Checks the variable is not null, throws an exception if it is
        /// </summary>
        /// <param name="variable">the object</param>
        /// <param name="variableName">name of the variable</param>
        public static void CheckForNullReference(object variable, string variableName)
        {
            if (variable == null)
                throw new ArgumentNullException(string.Format("{0} is required but was null", variableName));
        }

        /// <summary>
        /// Checks the variable is not empty, throws an exception if it is
        /// </summary>
        /// <param name="variable">the object</param>
        /// <param name="variableName">name of the variable</param>
        public static void CheckForEmptyString(string variable, string variableName)
        {
            CheckForNullReference(variable, variableName);
            CheckForNullReference(variableName, "variableName");

            if (variable.Length == 0)
            {
                throw new ArgumentException(string.Format("{0} is required but was empty", variableName));
            }
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Peer Placements Pty Ltd
Australia Australia
I live in Sydney and have been a developer for almost a decade now. I have a passion for technology and a strong interest in discovering 'better, cleaner, faster' ways to get systems out the door because I believe software development takes too long. If I have an idea I want to realise it as quickly as possible...plus writing systems for someone else I want to deliver quickly so I can move onto the next interesting project!

Comments and Discussions