public void Args_ShouldAddAdditionalArgsWithValue()
        {
            string    outputAssembly = "myapp.dll";
            BuildTask build          = new BuildTask("csc.exe", "library").OutputFileTo(outputAssembly).AddArgument("key", "value");

            build.BuildArgs();
            Assert.That(build._argumentBuilder.Build().Trim(), Is.EqualTo(String.Format("/key:value /out:\"{0}\" /target:{1}", outputAssembly, "library")));
        }
        public void Args_ShouldCreateProperArgsWithDefines()
        {
            string    outputAssembly = "myapp.dll";
            BuildTask build          = new BuildTask("csc.exe", "library").OutputFileTo(outputAssembly).DefineSymbol("NET20").DefineSymbol("TEST");

            build.BuildArgs();
            Assert.That(build._argumentBuilder.Build().Trim(), Is.EqualTo(String.Format("/out:\"{0}\" /target:{1} /define:NET20 /define:TEST", outputAssembly, "library")));
        }
        public void Args_ShouldCreateProperArgs_With_Resources()
        {
            string    reference      = "external.dll";
            string    outputAssembly = "myapp.dll";
            string    source         = "myfile.cs";
            BuildTask build          = new BuildTask("", "library").OutputFileTo(outputAssembly).AddResource("Test", "ResName");

            build.BuildArgs();
            Assert.That(build._argumentBuilder.Build().Trim(), Is.EqualTo(String.Format("/out:\"{0}\" /resource:\"Test\",ResName /target:{1}", outputAssembly, "library", reference, source)));
        }
        public void Args_ShouldCreateProperArgs_With_Fileset_Resources()
        {
            string    reference      = "external.dll";
            string    outputAssembly = "myapp.dll";
            string    source         = "myfile.cs";
            FileSet   sources        = new FileSet().Include(source);
            BuildTask build          = new BuildTask("", "library").OutputFileTo(outputAssembly).AddResources(sources);

            build.BuildArgs();
            Assert.That(build._argumentBuilder.Build().Trim(), Is.EqualTo(String.Format("/out:\"{0}\" /resource:\"myfile.cs\" /target:{1}", outputAssembly, "library")));
        }
        public void OutputFileTo_ShouldWorkWithBuildArtifact()
        {
            string    reference      = "external.dll";
            var       outputAssembly = new File("myapp.dll");
            string    source         = "myfile.cs";
            FileSet   sources        = new FileSet().Include(source);
            BuildTask build          = new BuildTask("", "library").OutputFileTo(outputAssembly).AddRefences(reference).AddSources(sources).IncludeDebugSymbols;

            build.BuildArgs();
            Assert.That(build._argumentBuilder.Build().Trim(), Is.EqualTo(String.Format("/out:\"{0}\" /target:{1} /reference:\"{2}\" /debug \"{3}\"", outputAssembly, "library", reference, source)));
        }
        public void Args_ShouldCreateProperReferences()
        {
            var references = new List <File>();

            references.Add(new File("ref1.dll"));
            references.Add(new File("ref2.dll"));

            string    outputAssembly = "myapp.dll";
            string    source         = "myfile.cs";
            FileSet   sources        = new FileSet().Include(source);
            BuildTask build          = new BuildTask("", "library").OutputFileTo(outputAssembly).AddRefences(references.ToArray()).AddSources(sources);

            build.BuildArgs();
            Assert.That(build._argumentBuilder.Build().Trim(), Is.EqualTo(String.Format("/out:\"{0}\" /target:{1} /reference:\"{2}\" /reference:\"{3}\" \"{4}\"", outputAssembly, "library", references[0], references[1], source)));
        }