public CSharpProjectGenerator(IBuildSystem buildSystem, string projectName, string outputDirectory)
{
Guard.NotNull(() => buildSystem, buildSystem);
this.buildSystem = buildSystem;
// Null arguments will not be accepted
if (projectName == null)
{
throw new ArgumentNullException(
"projectName",
Exceptions.ParameterCannotBeNull);
}
if (outputDirectory == null)
{
throw new ArgumentNullException(
"outputDirectory",
Exceptions.ParameterCannotBeNull);
}
// Empty arguments will not be accepted
if (projectName.Length == 0)
{
throw new ArgumentException(
Exceptions.StringCannotBeEmpty,
"projectName");
}
if (outputDirectory.Length == 0)
{
throw new ArgumentException(
Exceptions.StringCannotBeEmpty,
"outputDirectory");
}
// Ensure that the output directory is valid
if (!this.buildSystem.DirectoryExists(outputDirectory))
{
throw new ApplicationException(Exceptions.DirectoryCannotBeFound);
}
// Set our member variables
this.prjOutputDirectory = outputDirectory;
this.projectName = projectName;
// Set our collection member variables
this.ClassFiles = new List<string>();
// We know that we'll need a reference to the NUnit framework, so
// let's go ahead and add it
this.referencedAssemblies = new List<AssemblyName> { new AssemblyName("NUnit.Framework") };
}