public void TestDefaults () { LC lc = new LC (); lc.LicenseTarget = new TaskItem ("bar.exe"); lc.Sources = new ITaskItem [] { new TaskItem ("foo.licx") }; Assert.AreEqual ("bar.exe", lc.LicenseTarget.ItemSpec, "LicenseTarget"); Assert.AreEqual (false, lc.NoLogo, "NoLogo"); Assert.IsNull (lc.OutputDirectory, "OutputDirectory"); Assert.AreEqual (null, lc.OutputLicense, "OutputLicense"); Assert.IsNull (lc.ReferencedAssemblies, "ReferencedAssemblies"); Assert.AreEqual (1, lc.Sources.Length, "Number of Sources"); Assert.AreEqual ("foo.licx", lc.Sources [0].ItemSpec, "Sources [0]"); }
// Ignore: Doesn't work. public void SimpleValidArguments() { LC task = new LC(); task.BuildEngine = new MockEngine(); task.Sources = new TaskItem[] { new TaskItem("complist.licx"), new TaskItem("othersrc.txt") }; task.LicenseTarget = new TaskItem("target.exe"); task.OutputDirectory = "bin\\debug"; task.ReferencedAssemblies = new TaskItem[] { new TaskItem("LicensedControl.dll"), new TaskItem("OtherControl.dll") }; task.NoLogo = true; CommandLine.ValidateHasParameter(task, "/complist:complist.licx", false /* don't use response file */); CommandLine.ValidateHasParameter(task, "/complist:othersrc.txt", false /* don't use response file */); CommandLine.ValidateHasParameter(task, "/target:target.exe", false /* don't use response file */); CommandLine.ValidateHasParameter(task, "/outdir:bin\\debug", false /* don't use response file */); CommandLine.ValidateHasParameter(task, "/i:LicensedControl.dll", false /* don't use response file */); CommandLine.ValidateHasParameter(task, "/i:OtherControl.dll", false /* don't use response file */); CommandLine.ValidateHasParameter(task, "/nologo", false /* don't use response file */); }
public void TestAssignment1 () { LC lc = new LC (); lc.LicenseTarget = new TaskItem ("bar.exe"); lc.NoLogo = true; lc.OutputDirectory = "abc\\def"; lc.OutputLicense = new TaskItem ("bar.exe.licenses"); lc.ReferencedAssemblies = new ITaskItem [] { new TaskItem ("Test.dll") }; lc.Sources = new ITaskItem [] { new TaskItem ("foo.licx") }; Assert.AreEqual ("bar.exe", lc.LicenseTarget.ItemSpec, "LicenseTarget"); Assert.AreEqual (true, lc.NoLogo, "NoLogo"); Assert.AreEqual ("abc\\def", lc.OutputDirectory, "OutputDirectory"); Assert.AreEqual ("bar.exe.licenses", lc.OutputLicense.ItemSpec, "OutputLicense"); Assert.AreEqual (1, lc.ReferencedAssemblies.Length, "Number of ReferenceAssemblies"); Assert.AreEqual ("Test.dll", lc.ReferencedAssemblies [0].ItemSpec, "ReferencedAssemblies[0]"); Assert.AreEqual (1, lc.Sources.Length, "Number of Sources"); Assert.AreEqual ("foo.licx", lc.Sources [0].ItemSpec, "Sources [0]"); }