Skip to content

Commit 77dbae4

Browse files
committed
fix test utils references
1 parent 543e61a commit 77dbae4

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

test/ICSharpCode.SharpZipLib.Tests/TestSupport/Utils.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public TestTraceListener(TextWriter writer)
145145

146146
public override void WriteLine(string message) => _writer.WriteLine(message);
147147
public override void Write(string message) => _writer.Write(message);
148-
}
148+
}
149149

150150
public class TempFile : FileSystemInfo, IDisposable
151151
{
@@ -167,6 +167,8 @@ public override void Delete()
167167
_fileInfo.Delete();
168168
}
169169

170+
public FileStream Open(FileMode mode, FileAccess access) => _fileInfo.Open(mode, access);
171+
public FileStream Open(FileMode mode) => _fileInfo.Open(mode);
170172
public FileStream Create() => _fileInfo.Create();
171173

172174
public static TempFile WithDummyData(int size, string dirPath = null, string filename = null, int seed = Utils.DefaultSeed)

test/ICSharpCode.SharpZipLib.Tests/Zip/StreamHandling.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -554,11 +554,9 @@ public void ShouldThrowDescriptiveExceptionOnUncompressedDescriptorEntry()
554554
[Category("Zip")]
555555
public void IteratingOverEntriesInDirectUpdatedArchive([Values(0x0, 0x80)] byte padding)
556556
{
557-
using (var tempFile = new Utils.TempFile())
557+
using (var tempFile = new TempFile())
558558
{
559-
var fi = new FileInfo(tempFile.Filename);
560-
561-
using (var zf = ZipFile.Create(tempFile.Filename))
559+
using (var zf = ZipFile.Create(tempFile))
562560
{
563561
zf.BeginUpdate();
564562
// Add a "large" file, where the bottom 1023 bytes will become padding
@@ -570,10 +568,10 @@ public void IteratingOverEntriesInDirectUpdatedArchive([Values(0x0, 0x80)] byte
570568
}
571569

572570
// Since ZipFile doesn't support UpdateCommand.Modify yet we'll have to simulate it by patching the header
573-
Utils.PatchFirstEntrySize(fi.Open(FileMode.Open), 1);
571+
Utils.PatchFirstEntrySize(tempFile.Open(FileMode.Open), 1);
574572

575573
// Iterate updated entries
576-
using (var fs = File.OpenRead(tempFile.Filename))
574+
using (var fs = File.OpenRead(tempFile))
577575
using (var zis = new ZipInputStream(fs))
578576
{
579577
var firstEntry = zis.GetNextEntry();

0 commit comments

Comments
 (0)