Click here to Skip to main content
15,895,799 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;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using Agile.Genie.Descriptors;
using Agile.Genie.Generators;
using NUnit.Framework;

namespace GeneratorTests
{
    /// <summary>
    /// 
    /// </summary>
    [TestFixture]
    public class BuildFileGeneratorTests
    {
        #region CheckCodeGenerated Tests()

        /// <summary>
        /// Checks...
        /// </summary>
        [Test]
        public void CheckCodeGeneratedTests()
        {
            FileInfo file = GetCurrentProjectFile();
            BuildFileGenerator generator = BuildFileGenerator.Build(file);
            Assert.AreNotEqual(0, generator.Generate(), "a useless test");
        }

        private FileInfo GetCurrentProjectFile()
        {
            DirectoryInfo current = new DirectoryInfo(Environment.CurrentDirectory);
//            current.Parent.Parent
            DirectoryInfo projectDirectory = new DirectoryInfo(Path.Combine(current.Parent.Parent.Parent.FullName, "Generators"));

            return new FileInfo(Path.Combine(projectDirectory.FullName, "Generators.csproj"));
        }

        #endregion

        #region FindTestProject Tests()

        /// <summary>
        /// Checks...
        /// </summary>
        [Test]
        public void FindTestProjectTests()
        {
            FileInfo file = GetCurrentProjectFile();
            VisualStudioProjectFile projectFile = VisualStudioProjectFileFactory.Build(file);
            Assert.IsTrue(projectFile.HasTestProject);
        }

        #endregion
    }
}

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