public ValidBookmarkFileOnDisk() { var fileSystemAdapter = Substitute.For <IFileSystemAdapter>(); fileSystemAdapter .Open(Arg.Any <string>(), Arg.Any <FileMode>(), Arg.Any <FileAccess>(), Arg.Any <FileShare>()) .Returns(new MemoryStream( Encoding.UTF8.GetBytes($"{ExpectedBytePosition}:::{ExpectedBufferFilePath}\r\n"))); var provider = new FileBasedBookmarkProvider(BaseBufferFileName, fileSystemAdapter, Encoder); _sut = provider.GetCurrentBookmarkPosition(); _reread = provider.GetCurrentBookmarkPosition(); }
public InexistentBookmarkFileOnDisk() { var fileSystemAdapter = Substitute.For <IFileSystemAdapter>(); fileSystemAdapter .Open(Arg.Any <string>(), Arg.Any <FileMode>(), Arg.Any <FileAccess>(), Arg.Any <FileShare>()) .Returns(new MemoryStream(new byte[] { })); var provider = new FileBasedBookmarkProvider(BaseBufferFileName, fileSystemAdapter, Encoding.UTF8); _sut = provider.GetCurrentBookmarkPosition(); }