Пример #1
0
        public void GetImageInformationTest()
        {
            /*
             *  <WIM>
             *    <TOTALBYTES>139846944</TOTALBYTES>
             *    <IMAGE INDEX="1">
             *      <DIRCOUNT>2703</DIRCOUNT>
             *      <FILECOUNT>12369</FILECOUNT>
             *      <TOTALBYTES>862190505</TOTALBYTES>
             *      <HARDLINKBYTES>324280176</HARDLINKBYTES>
             *      <CREATIONTIME>
             *        <HIGHPART>0x01CE9F04</HIGHPART>
             *        <LOWPART>0x5F9E1B18</LOWPART>
             *      </CREATIONTIME>
             *      <LASTMODIFICATIONTIME>
             *        <HIGHPART>0x01CE9F04</HIGHPART>
             *        <LOWPART>0x607BDB5B</LOWPART>
             *      </LASTMODIFICATIONTIME>
             *      <WINDOWS>
             *        <ARCH>0</ARCH>
             *        <PRODUCTNAME>Microsoft® Windows® Operating System</PRODUCTNAME>
             *        <EDITIONID>WindowsPE</EDITIONID>
             *        <INSTALLATIONTYPE>WindowsPE</INSTALLATIONTYPE>
             *        <PRODUCTTYPE>WinNT</PRODUCTTYPE>
             *        <PRODUCTSUITE></PRODUCTSUITE>
             *        <LANGUAGES>
             *          <LANGUAGE>en-US</LANGUAGE>
             *          <DEFAULT>en-US</DEFAULT>
             *        </LANGUAGES>
             *        <VERSION>
             *          <MAJOR>6</MAJOR>
             *          <MINOR>3</MINOR>
             *          <BUILD>9600</BUILD>
             *          <SPBUILD>16384</SPBUILD>
             *          <SPLEVEL>0</SPLEVEL>
             *        </VERSION>
             *        <SYSTEMROOT>WINDOWS</SYSTEMROOT>
             *      </WINDOWS>
             *      <NAME>Microsoft Windows PE (x86)</NAME>
             *      <DESCRIPTION>Microsoft Windows PE (x86)</DESCRIPTION>
             *    </IMAGE>
             *  </WIM>
             */

            IXPathNavigable imageInformation = WimgApi.GetImageInformation(TestWimHandle);

            imageInformation.ShouldNotBeNull();

            XPathNavigator documentElement = imageInformation.CreateNavigator();

            documentElement.ShouldNotBeNull();

            VerifyXmlNodeText(documentElement, "//WIM/TOTALBYTES/text()");

            XPathNavigator imageNode = VerifyXmlNode(documentElement, "//WIM/IMAGE[@INDEX = '1']");

            XPathNavigator windowsNode = VerifyXmlNode(imageNode, "WINDOWS");

            VerifyXmlNodeText(imageNode, "DIRCOUNT/text()");
            VerifyXmlNodeText(imageNode, "FILECOUNT/text()");
            VerifyXmlNodeText(imageNode, "TOTALBYTES/text()");
            VerifyXmlNodeText(imageNode, "HARDLINKBYTES/text()");
            VerifyXmlNodeText(imageNode, "CREATIONTIME/HIGHPART/text()");
            VerifyXmlNodeText(imageNode, "CREATIONTIME/LOWPART/text()");
            VerifyXmlNodeText(imageNode, "LASTMODIFICATIONTIME/HIGHPART/text()");
            VerifyXmlNodeText(imageNode, "LASTMODIFICATIONTIME/LOWPART/text()");
            VerifyXmlNodeText(imageNode, "NAME/text()");
            VerifyXmlNodeText(imageNode, "DESCRIPTION/text()");
            VerifyXmlNodeText(windowsNode, "ARCH/text()");
            VerifyXmlNodeText(windowsNode, "PRODUCTNAME/text()");
            VerifyXmlNodeText(windowsNode, "EDITIONID/text()");
            VerifyXmlNodeText(windowsNode, "INSTALLATIONTYPE/text()");
            VerifyXmlNodeText(windowsNode, "PRODUCTTYPE/text()");
            VerifyXmlNodeText(windowsNode, "LANGUAGES/LANGUAGE/text()");
            VerifyXmlNodeText(windowsNode, "LANGUAGES/DEFAULT/text()");
            VerifyXmlNodeText(windowsNode, "VERSION/MAJOR/text()");
            VerifyXmlNodeText(windowsNode, "VERSION/MINOR/text()");
            VerifyXmlNodeText(windowsNode, "VERSION/BUILD/text()");
            VerifyXmlNodeText(windowsNode, "VERSION/SPBUILD/text()");
            VerifyXmlNodeText(windowsNode, "VERSION/SPLEVEL/text()");
            VerifyXmlNodeText(windowsNode, "SYSTEMROOT/text()");
        }