Exemplo n.º 1
0
        public void Configuration()
        {
            AL t = new AL();

            Assert.IsNull(t.Configuration, "Default value");
            t.Configuration = "debug";
            Assert.AreEqual("debug", t.Configuration, "New value");

            // Check the parameters.
            CommandLine.ValidateHasParameter(t, @"/configuration:debug");
        }
Exemplo n.º 2
0
        public void AlgorithmId()
        {
            AL t = new AL();

            Assert.IsNull(t.AlgorithmId, "Default value");
            t.AlgorithmId = "whatisthis";
            Assert.AreEqual("whatisthis", t.AlgorithmId, "New value");

            // Check the parameters.
            CommandLine.ValidateHasParameter(t, @"/algid:whatisthis");
        }
Exemplo n.º 3
0
        public void BaseAddress()
        {
            AL t = new AL();

            Assert.IsNull(t.BaseAddress, "Default value");
            t.BaseAddress = "12345678";
            Assert.AreEqual("12345678", t.BaseAddress, "New value");

            // Check the parameters.
            CommandLine.ValidateHasParameter(t, @"/baseaddress:12345678");
        }
Exemplo n.º 4
0
        public void CompanyName()
        {
            AL t = new AL();

            Assert.IsNull(t.CompanyName, "Default value");
            t.CompanyName = "Google";
            Assert.AreEqual("Google", t.CompanyName, "New value");

            // Check the parameters.
            CommandLine.ValidateHasParameter(t, @"/company:Google");
        }
Exemplo n.º 5
0
        public void EvidenceFile()
        {
            AL t = new AL();

            Assert.IsNull(t.EvidenceFile, "Default value");
            t.EvidenceFile = "MyEvidenceFile";
            Assert.AreEqual("MyEvidenceFile", t.EvidenceFile, "New value");

            // Check the parameters.
            CommandLine.ValidateHasParameter(t, @"/evidence:MyEvidenceFile");
        }
Exemplo n.º 6
0
Arquivo: ALTest.cs Projeto: GirlD/mono
		public void TestDefaultValues ()
		{
			AL al = new AL ();

			Assert.IsNull (al.AlgorithmId, "A1");	
			Assert.IsNull (al.BaseAddress, "A2");
			Assert.IsNull (al.CompanyName, "A3");
			Assert.IsNull (al.Configuration, "A4");
			Assert.IsNull (al.Copyright, "A5");
			Assert.IsNull (al.Culture, "A6");
			Assert.IsFalse (al.DelaySign, "A7");
			Assert.IsNull (al.Description, "A8");
			Assert.IsNull (al.EmbedResources, "A9");
			Assert.IsNull (al.EvidenceFile, "A10");
			Assert.IsNull (al.FileVersion, "A11");
			Assert.IsNull (al.Flags, "A12");
			Assert.IsFalse (al.GenerateFullPaths, "A13");
			Assert.IsNull (al.KeyContainer, "A14");
			Assert.IsNull (al.KeyFile, "A15");
			Assert.IsNull (al.LinkResources, "A16");
			Assert.IsNull (al.MainEntryPoint, "A17");
			Assert.IsNull (al.OutputAssembly, "A18");
			Assert.IsNull (al.Platform, "A19");
			Assert.IsNull (al.ProductName, "A20");
			Assert.IsNull (al.ProductVersion, "A21");
			Assert.IsNull (al.ResponseFiles, "A22");
			Assert.IsNull (al.SourceModules, "A23");
			Assert.IsNull (al.TargetType, "A24");
			Assert.IsNull (al.TemplateFile, "A25");
			Assert.IsNull (al.Title, "A26");
			Assert.IsNull (al.Trademark, "A27");
			Assert.IsNull (al.Version, "A28");
			Assert.IsNull (al.Win32Icon, "A29");
			Assert.IsNull (al.Win32Resource, "A30");
		}
Exemplo n.º 7
0
        public void Win32Resource()
        {
            AL t = new AL();

            Assert.IsNull(t.Win32Resource, "Default value");
            t.Win32Resource = "foo.res";
            Assert.AreEqual("foo.res", t.Win32Resource, "New value");

            // Check the parameters.
            CommandLine.ValidateHasParameter(t, @"/win32res:foo.res");
        }
Exemplo n.º 8
0
        public void Version()
        {
            AL t = new AL();

            Assert.IsNull(t.Version, "Default value");
            t.Version = "WowHowManyKindsOfVersionsAreThere";
            Assert.AreEqual("WowHowManyKindsOfVersionsAreThere", t.Version, "New value");

            // Check the parameters.
            CommandLine.ValidateHasParameter(t, @"/version:WowHowManyKindsOfVersionsAreThere");
        }
Exemplo n.º 9
0
        public void Title()
        {
            AL t = new AL();

            Assert.IsNull(t.Title, "Default value");
            t.Title = "WarAndPeace";
            Assert.AreEqual("WarAndPeace", t.Title, "New value");

            // Check the parameters.
            CommandLine.ValidateHasParameter(t, @"/title:WarAndPeace");
        }
Exemplo n.º 10
0
        public void TargetType()
        {
            AL t = new AL();

            Assert.IsNull(t.TargetType, "Default value");
            t.TargetType = "winexe";
            Assert.AreEqual("winexe", t.TargetType, "New value");

            // Check the parameters.
            CommandLine.ValidateHasParameter(t, @"/target:winexe");
        }
Exemplo n.º 11
0
        public void LinkResourcesWithTwoItems()
        {
            AL t = new AL();

            Assert.IsNull(t.LinkResources, "Default value");

            // Construct the task item.
            TaskItem i1 = new TaskItem();
            i1.ItemSpec = "MyResource.bmp";
            i1.SetMetadata("LogicalName", "Kenny");
            i1.SetMetadata("TargetFile", @"working\MyResource.bmp");
            i1.SetMetadata("Access", "Private");
            TaskItem i2 = new TaskItem();
            i2.ItemSpec = "MyResource2.bmp";
            i2.SetMetadata("LogicalName", "Chef");
            i2.SetMetadata("TargetFile", @"working\MyResource2.bmp");
            t.LinkResources = new ITaskItem[] { i1, i2 };

            Assert.AreEqual(2, t.LinkResources.Length, "New value");

            // Check the parameters.
            CommandLine.ValidateHasParameter(t, @"/link:MyResource.bmp,Kenny,working\MyResource.bmp,Private");
            CommandLine.ValidateHasParameter(t, @"/link:MyResource2.bmp,Chef,working\MyResource2.bmp");
        }
Exemplo n.º 12
0
        public void KeyContainer()
        {
            AL t = new AL();

            Assert.IsNull(t.KeyContainer, "Default value");
            t.KeyContainer = "MyKeyContainer";
            Assert.AreEqual("MyKeyContainer", t.KeyContainer, "New value");

            // Check the parameters.
            CommandLine.ValidateHasParameter(t, @"/keyname:MyKeyContainer");
        }
Exemplo n.º 13
0
        public void KeyFile()
        {
            AL t = new AL();

            Assert.IsNull(t.KeyFile, "Default value");
            t.KeyFile = "mykey.snk";
            Assert.AreEqual("mykey.snk", t.KeyFile, "New value");

            // Check the parameters.
            CommandLine.ValidateHasParameter(t, @"/keyfile:mykey.snk");
        }
Exemplo n.º 14
0
        public void GenerateFullPaths()
        {
            AL t = new AL();

            Assert.IsFalse(t.GenerateFullPaths, "Default value");
            t.GenerateFullPaths = true;
            Assert.IsTrue(t.GenerateFullPaths, "New value");

            // Check the parameters.
            CommandLine.ValidateHasParameter(t, "/fullpaths");
        }
Exemplo n.º 15
0
        public void Flags()
        {
            AL t = new AL();

            Assert.IsNull(t.Flags, "Default value");
            t.Flags = "0x8421";
            Assert.AreEqual("0x8421", t.Flags, "New value");

            // Check the parameters.
            CommandLine.ValidateHasParameter(t, @"/flags:0x8421");
        }
Exemplo n.º 16
0
        public void FileVersion()
        {
            AL t = new AL();

            Assert.IsNull(t.FileVersion, "Default value");
            t.FileVersion = "1.2.3.4";
            Assert.AreEqual("1.2.3.4", t.FileVersion, "New value");

            // Check the parameters.
            CommandLine.ValidateHasParameter(t, @"/fileversion:1.2.3.4");
        }
Exemplo n.º 17
0
        public void SourceModules()
        {
            AL t = new AL();

            Assert.IsNull(t.SourceModules, "Default value");

            // Construct the task items.
            TaskItem i1 = new TaskItem();
            i1.ItemSpec = "Strings.resources";
            i1.SetMetadata("TargetFile", @"working\MyResource.bmp");
            TaskItem i2 = new TaskItem();
            i2.ItemSpec = "Dialogs.resources";
            t.SourceModules = new ITaskItem[] { i1, i2 };

            Assert.AreEqual(2, t.SourceModules.Length, "New value");

            // Check the parameters.
            CommandLine.ValidateHasParameter(t, @"Strings.resources,working\MyResource.bmp");
            CommandLine.ValidateHasParameter(t, @"Dialogs.resources");
        }
Exemplo n.º 18
0
        public void MainEntryPoint()
        {
            AL t = new AL();

            Assert.IsNull(t.MainEntryPoint, "Default value");
            t.MainEntryPoint = "Class1.Main";
            Assert.AreEqual("Class1.Main", t.MainEntryPoint, "New value");

            // Check the parameters.
            CommandLine.ValidateHasParameter(t, @"/main:Class1.Main");
        }
Exemplo n.º 19
0
        public void TemplateFile()
        {
            AL t = new AL();

            Assert.IsNull(t.TemplateFile, "Default value");
            t.TemplateFile = "mymainassembly.dll";
            Assert.AreEqual("mymainassembly.dll", t.TemplateFile, "New value");

            // Check the parameters.
            CommandLine.ValidateHasParameter(t, @"/template:mymainassembly.dll");
        }
Exemplo n.º 20
0
        public void OutputAssembly()
        {
            AL t = new AL();

            Assert.IsNull(t.OutputAssembly, "Default value");
            t.OutputAssembly = new TaskItem("foo.dll");
            Assert.AreEqual("foo.dll", t.OutputAssembly.ItemSpec, "New value");

            // Check the parameters.
            CommandLine.ValidateHasParameter(t, @"/out:foo.dll");
        }
Exemplo n.º 21
0
        public void Trademark()
        {
            AL t = new AL();

            Assert.IsNull(t.Trademark, "Default value");
            t.Trademark = "MyTrademark";
            Assert.AreEqual("MyTrademark", t.Trademark, "New value");

            // Check the parameters.
            CommandLine.ValidateHasParameter(t, @"/trademark:MyTrademark");
        }
Exemplo n.º 22
0
        public void Platform()
        {
            AL t = new AL();

            Assert.IsNull(t.Platform, "Default value");
            t.Platform = "x86";
            Assert.AreEqual("x86", t.Platform, "New value");

            // Check the parameters.
            CommandLine.ValidateHasParameter(t, @"/platform:x86");
        }
Exemplo n.º 23
0
        public void Win32Icon()
        {
            AL t = new AL();

            Assert.IsNull(t.Win32Icon, "Default value");
            t.Win32Icon = "foo.ico";
            Assert.AreEqual("foo.ico", t.Win32Icon, "New value");

            // Check the parameters.
            CommandLine.ValidateHasParameter(t, @"/win32icon:foo.ico");
        }
Exemplo n.º 24
0
        public void PlatformAndPrefer32Bit()
        {
            // Implicit "anycpu"
            AL t = new AL();
            CommandLine.ValidateNoParameterStartsWith(t, @"/platform:");
            t = new AL();
            t.Prefer32Bit = false;
            CommandLine.ValidateNoParameterStartsWith(t, @"/platform:");
            t = new AL();
            t.Prefer32Bit = true;
            CommandLine.ValidateHasParameter(t, @"/platform:anycpu32bitpreferred");

            // Explicit "anycpu"
            t = new AL();
            t.Platform = "anycpu";
            CommandLine.ValidateHasParameter(t, @"/platform:anycpu");
            t = new AL();
            t.Platform = "anycpu";
            t.Prefer32Bit = false;
            CommandLine.ValidateHasParameter(t, @"/platform:anycpu");
            t = new AL();
            t.Platform = "anycpu";
            t.Prefer32Bit = true;
            CommandLine.ValidateHasParameter(t, @"/platform:anycpu32bitpreferred");

            // Explicit "x86"
            t = new AL();
            t.Platform = "x86";
            CommandLine.ValidateHasParameter(t, @"/platform:x86");
            t = new AL();
            t.Platform = "x86";
            t.Prefer32Bit = false;
            CommandLine.ValidateHasParameter(t, @"/platform:x86");
            t = new AL();
            t.Platform = "x86";
            t.Prefer32Bit = true;
            CommandLine.ValidateHasParameter(t, @"/platform:x86");
        }
Exemplo n.º 25
0
        public void ProductName()
        {
            AL t = new AL();

            Assert.IsNull(t.ProductName, "Default value");
            t.ProductName = "VisualStudio";
            Assert.AreEqual("VisualStudio", t.ProductName, "New value");

            // Check the parameters.
            CommandLine.ValidateHasParameter(t, @"/product:VisualStudio");
        }
Exemplo n.º 26
0
        public void ProductVersion()
        {
            AL t = new AL();

            Assert.IsNull(t.ProductVersion, "Default value");
            t.ProductVersion = "8.0";
            Assert.AreEqual("8.0", t.ProductVersion, "New value");

            // Check the parameters.
            CommandLine.ValidateHasParameter(t, @"/productversion:8.0");
        }
Exemplo n.º 27
0
        public void Copyright()
        {
            AL t = new AL();

            Assert.IsNull(t.Copyright, "Default value");
            t.Copyright = "(C) 2005";
            Assert.AreEqual("(C) 2005", t.Copyright, "New value");

            // Check the parameters.
            CommandLine.ValidateHasParameter(t, @"/copyright:(C) 2005");
        }
Exemplo n.º 28
0
        public void ResponseFiles()
        {
            AL t = new AL();

            Assert.IsNull(t.ResponseFiles, "Default value");
            t.ResponseFiles = new string[2] { "one.rsp", "two.rsp" };
            Assert.AreEqual(2, t.ResponseFiles.Length, "New value");

            // Check the parameters.
            CommandLine.ValidateHasParameter(t, @"@one.rsp");
            CommandLine.ValidateHasParameter(t, @"@two.rsp");
        }
Exemplo n.º 29
0
Arquivo: ALTest.cs Projeto: GirlD/mono
		public void TestAssignment1 ()
		{
			AL al = new AL ();

			al.AlgorithmId = "1";
			al.BaseAddress = "2";
			al.CompanyName = "3";
			al.Configuration = "4";
			al.Copyright = "5";
			al.Culture = "6";
			al.DelaySign = true;
			al.Description = "7";
			al.EmbedResources = new ITaskItem [1] { new TaskItem ("8") };
			al.EvidenceFile = "9";
			al.FileVersion = "10";
			al.Flags = "11";
			al.GenerateFullPaths = true;
			al.KeyContainer = "12";
			al.KeyFile = "13";
			al.LinkResources = new ITaskItem [1] { new TaskItem ("14") };
			al.MainEntryPoint = "15";
			al.OutputAssembly = new TaskItem ("16");
			al.Platform = "17";
			al.ProductName = "18";
			al.ProductVersion = "19";
			al.ResponseFiles = new string [1] { "20" };
			al.SourceModules = new ITaskItem [1] { new TaskItem ("21") };
			al.TargetType = "22";
			al.TemplateFile = "23";
			al.Title = "24";
			al.Trademark = "25";
			al.Version = "26";
			al.Win32Icon = "27";
			al.Win32Resource = "28";

			Assert.AreEqual ("1", al.AlgorithmId, "A1");
			Assert.AreEqual ("2", al.BaseAddress, "A2");
			Assert.AreEqual ("3", al.CompanyName, "A3");
			Assert.AreEqual ("4", al.Configuration, "A4");
			Assert.AreEqual ("5", al.Copyright, "A5");
			Assert.AreEqual ("6", al.Culture, "A6");
			Assert.AreEqual (true, al.DelaySign, "A7");
			Assert.AreEqual ("7", al.Description, "A8");
			Assert.AreEqual ("8", al.EmbedResources [0].ItemSpec, "A9");
			Assert.AreEqual ("9", al.EvidenceFile, "A10");
			Assert.AreEqual ("10", al.FileVersion, "A11");
			Assert.AreEqual ("11", al.Flags, "A12");
			Assert.AreEqual (true, al.GenerateFullPaths, "A13");
			Assert.AreEqual ("12", al.KeyContainer, "A14");
			Assert.AreEqual ("13", al.KeyFile, "A15");
			Assert.AreEqual ("14", al.LinkResources [0].ItemSpec, "A16");
			Assert.AreEqual ("15", al.MainEntryPoint, "A17");
			Assert.AreEqual ("16", al.OutputAssembly.ItemSpec, "A18");
			Assert.AreEqual ("17", al.Platform, "A19");
			Assert.AreEqual ("18", al.ProductName, "A20");
			Assert.AreEqual ("19", al.ProductVersion, "A21");
			Assert.AreEqual ("20", al.ResponseFiles [0], "A22");
			Assert.AreEqual ("21", al.SourceModules [0].ItemSpec, "A23");
			Assert.AreEqual ("22", al.TargetType, "A24");
			Assert.AreEqual ("23", al.TemplateFile, "A25");
			Assert.AreEqual ("24", al.Title, "A26");
			Assert.AreEqual ("25", al.Trademark, "A27");
			Assert.AreEqual ("26", al.Version, "A28");
			Assert.AreEqual ("27", al.Win32Icon, "A29");
			Assert.AreEqual ("28", al.Win32Resource, "A30");
		}
Exemplo n.º 30
0
        public void EmbedResourcesWithPrivateAccess()
        {
            AL t = new AL();

            Assert.IsNull(t.EmbedResources, "Default value");

            // Construct the task item.
            TaskItem i = new TaskItem();
            i.ItemSpec = "MyResource.bmp";
            i.SetMetadata("LogicalName", "Kenny");
            i.SetMetadata("Access", "Private");
            t.EmbedResources = new ITaskItem[] { i };

            Assert.AreEqual(1, t.EmbedResources.Length, "New value");

            // Check the parameters.
            CommandLine.ValidateHasParameter(t, "/embed:MyResource.bmp,Kenny,Private");
        }