コード例 #1
0
        public void DecryptDownloadTest()
        {
            DocxLoader docxLoader = new DocxLoader(directory + pathTest1, Encoding.UTF8);

            docxLoader.Decrypt(new EncryptingMachine());
            docxLoader.Download(directory + pathTest2, true);
            docxLoader = new DocxLoader(directory + pathTest2, Encoding.UTF8);
            DocxLoader docxLoaderRes = new DocxLoader(directory + pathTest1res, Encoding.UTF8);

            Assert.Equal(docxLoaderRes.Print(), docxLoader.Print());
        }
コード例 #2
0
        public void Overwrite()
        {
            DocxLoader docxLoader = new DocxLoader(directory + pathTest1, Encoding.UTF8);

            try
            {
                docxLoader.Download(directory + pathTest1res, false);
                throw new Exception("not passed");
            }
            catch (Exception ex)
            {
                Assert.Equal("File couldn't be overwritten", ex.Message);
            }
        }