Index: test/Common/DelftTools.Utils.Tests/IO/ZipFileTest.cs =================================================================== diff -u -rb1728d26142119f9e21c35acb4c390fdae8abcac -r5fc71a385897af92ccb092f2f969b5709afab85a --- test/Common/DelftTools.Utils.Tests/IO/ZipFileTest.cs (.../ZipFileTest.cs) (revision b1728d26142119f9e21c35acb4c390fdae8abcac) +++ test/Common/DelftTools.Utils.Tests/IO/ZipFileTest.cs (.../ZipFileTest.cs) (revision 5fc71a385897af92ccb092f2f969b5709afab85a) @@ -23,12 +23,18 @@ { var path = TestHelper.GetCurrentMethodName() + ".zip"; - DeleteFilesIfExist(new[] { path }); + DeleteFilesIfExist(new[] + { + path + }); - ZipFileUtils.Create(path,null); + ZipFileUtils.Create(path, null); var fileExists = File.Exists(path); - DeleteFilesIfExist(new[] { path }); + DeleteFilesIfExist(new[] + { + path + }); Assert.IsTrue(fileExists); } @@ -37,7 +43,10 @@ public void CreateEmptyZipFileWithOverwrite() { var path = TestHelper.GetCurrentMethodName() + ".zip"; - DeleteFilesIfExist(new[] { path }); + DeleteFilesIfExist(new[] + { + path + }); File.Create(path).Close(); @@ -47,13 +56,19 @@ } catch (Exception) { - DeleteFilesIfExist(new[] { path }); + DeleteFilesIfExist(new[] + { + path + }); Assert.Fail("File should be overwritten"); } - + var fileExists = File.Exists(path); - DeleteFilesIfExist(new[] { path }); + DeleteFilesIfExist(new[] + { + path + }); Assert.IsTrue(fileExists); } @@ -63,7 +78,10 @@ { var path = TestHelper.GetCurrentMethodName() + ".zip"; - DeleteFilesIfExist(new[] { path }); + DeleteFilesIfExist(new[] + { + path + }); File.Create(path).Close(); @@ -74,7 +92,10 @@ } catch (Exception) { - DeleteFilesIfExist(new[] { path }); + DeleteFilesIfExist(new[] + { + path + }); } } @@ -85,30 +106,47 @@ const string file1Path = @".\file1.txt"; const string file2Path = @".\file2.txt"; - DeleteFilesIfExist(new[] { zipFilePath, file1Path, file2Path }); - + DeleteFilesIfExist(new[] + { + zipFilePath, + file1Path, + file2Path + }); + var file1 = File.CreateText(file1Path); var file2 = File.CreateText(file2Path); - + file1.WriteLine("TestFile1"); file2.WriteLine("TestFile2"); file1.Close(); file2.Close(); - ZipFileUtils.Create(zipFilePath, new List { file1Path, file2Path }); - + ZipFileUtils.Create(zipFilePath, new List + { + file1Path, file2Path + }); + var zipfileExists = File.Exists(zipFilePath); - DeleteFilesIfExist(new[] { file1Path, file2Path }); + DeleteFilesIfExist(new[] + { + file1Path, + file2Path + }); ZipFileUtils.Extract(zipFilePath, "."); var file1Exists = File.Exists(file1Path); var file2Exists = File.Exists(file2Path); - DeleteFilesIfExist(new[] { zipFilePath, file1Path, file2Path }); - + DeleteFilesIfExist(new[] + { + zipFilePath, + file1Path, + file2Path + }); + Assert.IsTrue(zipfileExists); Assert.IsTrue(file1Exists); Assert.IsTrue(file2Exists); @@ -121,28 +159,48 @@ const string file1Path = @".\file1.txt"; const string file2Path = @".\dir\file2.txt"; - DeleteFilesIfExist(new []{zipFilePath, file1Path, file2Path}); + DeleteFilesIfExist(new[] + { + zipFilePath, + file1Path, + file2Path + }); Directory.CreateDirectory(@".\dir"); CreateTestFile(file1Path); CreateTestFile(file2Path); - ZipFileUtils.Create(zipFilePath, new List { file1Path, file2Path }); + ZipFileUtils.Create(zipFilePath, new List + { + file1Path, file2Path + }); var zipfileExists = File.Exists(zipFilePath); - Directory.Delete(@".\dir",true); - DeleteFilesIfExist(new []{file1Path,file2Path}); + Directory.Delete(@".\dir", true); + DeleteFilesIfExist(new[] + { + file1Path, + file2Path + }); ZipFileUtils.Extract(zipFilePath, "."); - DeleteFilesIfExist(new []{zipFilePath}); + DeleteFilesIfExist(new[] + { + zipFilePath + }); var file1Exists = File.Exists(file1Path); var file2Exists = File.Exists(file2Path); - DeleteFilesIfExist(new[] { zipFilePath, file1Path, file2Path }); + DeleteFilesIfExist(new[] + { + zipFilePath, + file1Path, + file2Path + }); Assert.IsTrue(zipfileExists); Assert.IsTrue(file1Exists); @@ -160,7 +218,10 @@ { foreach (var path in paths) { - if (File.Exists(path)) File.Delete(path); + if (File.Exists(path)) + { + File.Delete(path); + } } } }