Ejemplo n.º 1
0
        public void GetXMLActionTest()
        {
            RenameRegKeyAction target = new RenameRegKeyAction();

            target.RegKey  = @"HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft";
            target.NewName = "Java-Soft";
            string expected = "<Action>\r\n<ElementType>CustomActions.RenameRegKeyAction</ElementType>\r\n<Hive>HKEY_LOCAL_MACHINE</Hive>\r\n<RegKey>SOFTWARE\\JavaSoft</RegKey>\r\n<UseReg32>False</UseReg32>\r\n<NewName>Java-Soft</NewName>\r\n</Action>";
            string actual;

            actual = target.GetXMLAction();
            Assert.AreEqual(expected, actual, true, "The 'GetXMLAction' method doesn't return the good string");

            target.RegKey = @"   HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft  ";
            actual        = target.GetXMLAction();
            Assert.AreEqual(expected, actual, true, "The 'GetXMLAction' method doesn't return the good string");
            target.NewName = "  Java-Soft   ";
            actual         = target.GetXMLAction();
            Assert.AreEqual(expected, actual, true, "The 'GetXMLAction' method doesn't return the good string");
        }