Skip to content

Commit

Permalink
Update TestTempFile.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
Bykiev committed Jan 3, 2024
1 parent 4e11700 commit ede309e
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions testcases/main/Util/TestTempFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ public void TestCreateTempFile()
FileInfo fileInfo = null;
Assert.DoesNotThrow(() => fileInfo = TempFile.CreateTempFile("test", ".xls"));

Assert.IsTrue(File.Exists(fileInfo.FullName));
Assert.IsTrue(fileInfo!=null && fileInfo.Exists);

string tempDirPath = Path.GetDirectoryName(fileInfo.FullName);

if(Directory.Exists(tempDirPath))
Directory.Delete(tempDirPath, true);

Assert.IsFalse(File.Exists(fileInfo.FullName));
Assert.IsFalse(fileInfo!=null && fileInfo.Exists);
Assert.IsFalse(Directory.Exists(tempDirPath));

FileInfo file = null;
Expand All @@ -49,12 +49,8 @@ public void TestGetTempFilePath()

Assert.IsFalse(Directory.Exists(tempDirPath));

string fileName = "";
Assert.DoesNotThrow(() => fileName = TempFile.GetTempFilePath("test", ".xls"));
Assert.DoesNotThrow(() => TempFile.GetTempFilePath("test", ".xls"));
Assert.IsTrue(Directory.Exists(tempDirPath));

if(File.Exists(fileName))
File.Delete(fileName);
}
}
}

0 comments on commit ede309e

Please sign in to comment.