public void Initialize(System.IO.Stream fileStream)
		{
			_zipWorker = new ZipWorker(true);
			_zipWorker.Extract(fileStream);

			if (!_zipWorker.IsValid)
			{
				_isValid = false;
				_exceptionMessage = _zipWorker.ExceptionMessage;

				Close();

				return;
			}

			ReadGlobals();
		}
Exemplo n.º 2
0
        public void ZipWorker_Extract_Test()
        {
            var zipper = new ZipWorker();
            zipper.Extract(Helper.GetTestWorkbook("TestChess"));
            Assert.AreEqual(false, Directory.Exists(zipper.TempPath));
            Assert.AreEqual(false, zipper.IsValid);

            zipper.Extract(Helper.GetTestWorkbook("xTestOpenXml"));

            Assert.AreEqual(true, Directory.Exists(zipper.TempPath));
            Assert.AreEqual(true, zipper.IsValid);

            string tPath = zipper.TempPath;

            zipper.Dispose();

            Assert.AreEqual(false, Directory.Exists(tPath));
        }