Example #1
0
        public void FlushTest()
        {
            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

            target.Flush();
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }
Example #2
0
 protected override void Act()
 {
     try
     {
         _target.Flush();
         Assert.Fail();
     }
     catch (ObjectDisposedException ex)
     {
         _actualException = ex;
     }
 }
        public void FlushShouldFlushBuffer()
        {
            byte[] actualFlushedData = null;

            SftpSessionMock.InSequence(MockSequence)
            .Setup(p => p.IsOpen)
            .Returns(true);
            SftpSessionMock.InSequence(MockSequence)
            .Setup(p => p.RequestWrite(_handle, _expectedWrittenByteCount, It.IsAny <byte[]>(), 0, _expectedBufferedByteCount, It.IsAny <AutoResetEvent>(), null))
            .Callback <byte[], ulong, byte[], int, int, AutoResetEvent, Action <SftpStatusResponse> >((handle, serverFileOffset, data, offset, length, wait, writeCompleted) => actualFlushedData = data.Take(offset, length));

            _target.Flush();

            Assert.IsTrue(actualFlushedData.IsEqualTo(_expectedBufferedBytes));

            SftpSessionMock.Verify(p => p.RequestWrite(_handle, _expectedWrittenByteCount, It.IsAny <byte[]>(), 0, _expectedBufferedByteCount, It.IsAny <AutoResetEvent>(), null), Times.Once);
        }
 protected override void Act()
 {
     _target.Flush();
 }
Example #5
0
 public override void Flush()
 {
     _fs.Flush();
 }