/// <summary>
 /// Initializes a new instance of the <see cref="CSharpMbUnitRhinoMocksCodeGenerator"/> class
 /// based the given <see cref="CodeNamespace"/> which will output to the given directory.
 /// </summary>
 /// <param name="buildSystem">The build system.</param>
 /// <param name="codeNamespace">The code namespace.</param>
 /// <param name="testBuilders">The test builder repository.</param>
 /// <param name="configuration">The configuration of the generator.</param>
 /// <exception cref="System.ArgumentNullException"><paramref name="codeNamespace"/> or
 /// <cref name="ICodeGeneratorParameters.OutputDirectory"/> is <c>null</c>.</exception>
 /// <exception cref="System.ArgumentException"><cref name="ICodeGeneratorParameters.OutputDirectory"/> is an
 /// empty string.</exception>
 /// <exception cref="ApplicationException"><cref name="ICodeGeneratorParameters.OutputDirectory"/>
 /// cannot be found.</exception>
 public CSharpMbUnitRhinoMocksCodeGenerator(
     IBuildSystem buildSystem,
     CodeNamespace codeNamespace,
     IMemberBuilderFactory testBuilders,
     ICodeGeneratorParameters configuration)
     : base(buildSystem, codeNamespace, testBuilders, configuration)
 {
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CSharpMbUnitCodeGenerator"/> class
 /// based the given <see cref="CodeNamespace"/> which will output to the given directory.
 /// </summary>
 /// <param name="buildSystem">The build system.</param>
 /// <param name="codeNamespace">The code namespace.</param>
 /// <param name="testBuilders">The test builder repository.</param>
 /// <param name="configuration">The configuration of the generator.</param>
 /// <exception cref="System.ArgumentNullException"><paramref name="codeNamespace"/> or
 ///   <cref name="ICodeGeneratorParameters.OutputDirectory"/> is <c>null</c>.</exception>
 /// <exception cref="System.ArgumentException"><cref name="ICodeGeneratorParameters.OutputDirectory"/> is an
 /// empty string.</exception>
 /// <exception cref="System.ApplicationException"><cref name="ICodeGeneratorParameters.OutputDirectory"/>
 /// cannot be found.</exception>
 public CSharpMbUnitCodeGenerator(
     IBuildSystem buildSystem,
     CodeNamespace codeNamespace,
     IMemberBuilderFactory testBuilders,
     ICodeGeneratorParameters configuration)
     : base(buildSystem, codeNamespace, testBuilders, configuration)
 {
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CSharpCodeGenerator"/> class
        /// based the given <see cref="CodeNamespace"/> which will output to the given directory.
        /// </summary>
        /// <param name="buildSystem">The build system.</param>
        /// <param name="codeNamespace">The code namespace.</param>
        /// <param name="testBuilders">The test builders.</param>
        /// <param name="configuration">The configuration.</param>
        /// <exception cref="System.ArgumentNullException"><paramref name="codeNamespace"/> or
        /// outputDirectory is <see langword="null"/>.</exception>
        /// <exception cref="System.ArgumentException">outputDirectory is an
        /// empty string.</exception>
        /// <exception cref="System.IO.DirectoryNotFoundException">outputDirectory
        /// cannot be found.</exception>
        /// <exception cref="ApplicationException"><c>ApplicationException</c> Directory Cannot Be Found.</exception>
        public CSharpCodeGenerator(
            IBuildSystem buildSystem,
            CodeNamespace codeNamespace,
            IMemberBuilderFactory testBuilders,
            ICodeGeneratorParameters configuration)
        {
            Guard.NotNull(() => buildSystem, buildSystem);
            this.buildSystem = buildSystem;
            Guard.NotNull(() => configuration, configuration);

            // this.configuration = configuration;
            string outputDirectory = configuration.OutputDirectory;

            // Null arguments will not be accepted
            if (codeNamespace == null)
            {
                throw new ArgumentNullException(
                    "codeNamespace",
                    Exceptions.ParameterCannotBeNull);
            }

            if (outputDirectory == null)
            {
                throw new ArgumentNullException(
                    "outputDirectory",
                    Exceptions.ParameterCannotBeNull);
            }

            // Ensure that the output directory is not empty
            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);
            }

            this.codeNamespace = codeNamespace;
            this.OutputDirectory = outputDirectory;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CSharpCodeGenerator"/> class
        /// based the given <see cref="CodeNamespace"/> which will output to the given directory.
        /// </summary>
        /// <param name="buildSystem">The build system.</param>
        /// <param name="codeNamespace">The code namespace.</param>
        /// <param name="testBuilders">The test builders.</param>
        /// <param name="configuration">The configuration.</param>
        /// <exception cref="System.ArgumentNullException"><paramref name="codeNamespace"/> or
        /// outputDirectory is <see langword="null"/>.</exception>
        /// <exception cref="System.ArgumentException">outputDirectory is an
        /// empty string.</exception>
        /// <exception cref="System.IO.DirectoryNotFoundException">outputDirectory
        /// cannot be found.</exception>
        /// <exception cref="ApplicationException"><c>ApplicationException</c> Directory Cannot Be Found.</exception>
        public CSharpCodeGenerator(
            IBuildSystem buildSystem,
            CodeNamespace codeNamespace,
            IMemberBuilderFactory testBuilders,
            ICodeGeneratorParameters configuration)
        {
            Guard.NotNull(() => buildSystem, buildSystem);
            this.buildSystem = buildSystem;
            Guard.NotNull(() => configuration, configuration);

            // this.configuration = configuration;
            string outputDirectory = configuration.OutputDirectory;

            // Null arguments will not be accepted
            if (codeNamespace == null)
            {
                throw new ArgumentNullException(
                          "codeNamespace",
                          Exceptions.ParameterCannotBeNull);
            }

            if (outputDirectory == null)
            {
                throw new ArgumentNullException(
                          "outputDirectory",
                          Exceptions.ParameterCannotBeNull);
            }

            // Ensure that the output directory is not empty
            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);
            }

            this.codeNamespace   = codeNamespace;
            this.OutputDirectory = outputDirectory;
        }
Ejemplo n.º 5
0
 private void SetupInstance()
 {
     BuildProperties = new BuildDataDictionary();
     Memberfactory = MemberBuilderFactory.Default;
 }