private void ProcessLines() { try { using (SftpFileStream stream = this.Client.OpenRead(this.Path)) { stream.Seek(0, SeekOrigin.End); using (StreamReader reader = new StreamReader(stream)) { while (!this.CancellationTokenSource.IsCancellationRequested) { String line = reader.ReadLine(); if (!String.IsNullOrEmpty(line)) { this.LineQueue.Enqueue(line); if (this.LineQueue.Count > this.LineCapacity) { this.LineQueue.TryDequeue(out line); } } } } } } catch { } }
protected override void Act() { try { _target.Seek(_offset, SeekOrigin.Begin); Assert.Fail(); } catch (EndOfStreamException ex) { _actualException = ex; } }
public void SeekTest() { SftpSession session = null; // TODO: Initialize to an appropriate value string path = string.Empty; // TODO: Initialize to an appropriate value FileMode mode = new FileMode(); // TODO: Initialize to an appropriate value SftpFileStream target = new SftpFileStream(session, path, mode); // TODO: Initialize to an appropriate value long offset = 0; // TODO: Initialize to an appropriate value SeekOrigin origin = new SeekOrigin(); // TODO: Initialize to an appropriate value long expected = 0; // TODO: Initialize to an appropriate value long actual; actual = target.Seek(offset, origin); Assert.AreEqual(expected, actual); Assert.Inconclusive("Verify the correctness of this test method."); }
protected override void Act() { _actual = _target.Seek(0L, SeekOrigin.Begin); }
public override long Seek(long offset, SeekOrigin origin) { return(_fs.Seek(offset, origin)); }