Click here to Skip to main content
12,818,438 members (33,164 online)
Click here to Skip to main content
Articles » Languages » C# » Utilities » Downloads


68 bookmarked
Posted 25 Mar 2008


, 25 Mar 2008 CPOL
Generate Zip archives without third-party support
// Copyright (c) 2008 Blue Onion Software
// All rights reserved

using NUnit.Framework;
using System;
using System.IO;

namespace BlueOnionSoftware.SimpleZip
    public class SimpleZipUnitTests
        public void ZipTo()
            using (var fileStream = File.Create(""))
                SimpleZip.ZipTo(new string[] { @"TextFile1.txt", @"TextFile2.txt", @"TextFile3.txt" }, fileStream);

            System.IO.FileInfo fileInfo = new FileInfo("");
            Assert.AreEqual(8950, fileInfo.Length);

        public void ZipTo2()
            // Test with paths...
            FileInfo textFile1 = new FileInfo("textFile1.txt");
            FileInfo textFile2 = new FileInfo("textFile2.txt");
            FileInfo textFile3 = new FileInfo("textFile3.txt");

            using (var fileStream = File.Create(""))
                SimpleZip.ZipTo(new string[] { textFile1.FullName, textFile2.FullName, textFile3.FullName }, fileStream);

            System.IO.FileInfo fileInfo = new System.IO.FileInfo("");
            Assert.Greater(fileInfo.Length, 8950);

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Software Developer (Senior)
United States United States
No Biography provided

You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170308.1 | Last Updated 25 Mar 2008
Article Copyright 2008 by mikeward001
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid