Ejemplo n.º 1
0
        public void Initialize()
        {
            this.mockFileSystem = new Mock <IFileSystem>();
            this.mockDirectory  = new MockDirectory {
                DirectoryExists = true
            };
            this.mockFileSystem.SetupGet(x => x.Directory).Returns(this.mockDirectory);
            this.service = new ZipperService(this.mockFileSystem.Object);

            this.BuildTestZipFile();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Mains the specified args.
        /// </summary>
        /// <param name="args">The args.</param>
        public static void Main(string[] args)
        {
            if (args == null)
            {
                Console.WriteLine("args are null");
            }
            else
            {
                if (args.Length == 2)
                {
                    ZipperService zipperService = new ZipperService();

                    //// directory where the zip files are
                    string zipFile = args[0];

                    bool exists = File.Exists(zipFile);

                    if (exists)
                    {
                        //// the lib folder where the dlls will have been updated.
                        string updatesDirectory = args[1];

                        exists = Directory.Exists(updatesDirectory);

                        if (exists)
                        {
                            zipperService.UpdateZip(zipFile, updatesDirectory, "Lib", true, true);
                        }
                        else
                        {
                            Console.WriteLine("Directory " + updatesDirectory + " does not exist");
                        }
                    }
                    else
                    {
                        Console.WriteLine("File " + zipFile + " does not exist");
                    }
                }
                else
                {
                    Console.WriteLine("args are not valid");
                }
            }
        }