Index: Core/Common/test/Core.Common.TestUtil.Test/FileDisposeHelperTest.cs =================================================================== diff -u -r4477e75623600b68603b5f96175eea2431fe1cd5 -r31d55816d45c51c33448bd9e49e2ef6d6b6ec07c --- Core/Common/test/Core.Common.TestUtil.Test/FileDisposeHelperTest.cs (.../FileDisposeHelperTest.cs) (revision 4477e75623600b68603b5f96175eea2431fe1cd5) +++ Core/Common/test/Core.Common.TestUtil.Test/FileDisposeHelperTest.cs (.../FileDisposeHelperTest.cs) (revision 31d55816d45c51c33448bd9e49e2ef6d6b6ec07c) @@ -30,13 +30,14 @@ public void Constructor_ExistingFile_DoesNotThrowException() { // Setup - string filePath = "doesNotExist.tmp"; + string filePath = "doesExist.tmp"; FileDisposeHelper disposeHelper = null; try { - // Precondition using (File.Create(filePath)) {} + + // Precondition Assert.IsTrue(File.Exists(filePath), String.Format("Precondition failed: File '{0}' should exist", filePath)); // Call @@ -55,14 +56,16 @@ } [Test] - public void CreateFile_FileDoesNotExist_Createsfile() + public void Create_FileDoesNotExist_Createsfile() { // Setup - string filePath = "doesExist.tmp"; + string filePath = "willExist.tmp"; try { + // Precondition Assert.IsFalse(File.Exists(filePath)); + using (var fileDisposeHelper = new FileDisposeHelper(filePath)) { // Call @@ -81,19 +84,21 @@ } [Test] - public void CreateFile_InvalidPath_DoesNotThrowException() + public void Create_InvalidPath_DoesNotThrowException() { // Setup - string filePath = String.Empty; + var filePath = String.Empty; + var fileDisposeHelper = new FileDisposeHelper(filePath); - TestDelegate test = () => new FileDisposeHelper(filePath); + // Call + TestDelegate test = () => fileDisposeHelper.Create(); // Assert Assert.DoesNotThrow(test); } [Test] - public void CreateFile_MultipleFiles_CreatesFiles() + public void Create_MultipleFiles_CreatesFiles() { // Setup var filePaths = new[] @@ -104,9 +109,9 @@ try { - // Call using (var fileDisposeHelper = new FileDisposeHelper(filePaths)) { + // Call fileDisposeHelper.Create(); // Assert @@ -148,6 +153,8 @@ try { using (File.Create(filePath)) {} + + // Precondition Assert.IsTrue(File.Exists(filePath)); // Call @@ -178,6 +185,8 @@ foreach (var filePath in filePaths) { using (File.Create(filePath)) {} + + // Precondition Assert.IsTrue(File.Exists(filePath)); }