public void GetWriteChannelSourceAsync_should_delegate_to_reference() { var subject = new ReadWriteBindingHandle(_readWriteBinding); subject.GetWriteChannelSourceAsync(CancellationToken.None); _readWriteBinding.Received().GetWriteChannelSourceAsync(CancellationToken.None); }
public void Session_should_delegate_to_reference() { var subject = new ReadWriteBindingHandle(_mockReadWriteBinding.Object); var result = subject.Session; _mockReadWriteBinding.Verify(m => m.Session, Times.Once); }
public void GetWriteConnectionSourceAsync_should_delegate_to_reference() { var subject = new ReadWriteBindingHandle(_readWriteBinding); subject.GetWriteConnectionSourceAsync(Timeout.InfiniteTimeSpan, CancellationToken.None); _readWriteBinding.Received().GetWriteConnectionSourceAsync(Timeout.InfiniteTimeSpan, CancellationToken.None); }
public void GetWriteConnectionSourceAsync_should_throw_if_disposed() { var subject = new ReadWriteBindingHandle(_readWriteBinding); subject.Dispose(); Action act = () => subject.GetWriteConnectionSourceAsync(Timeout.InfiniteTimeSpan, CancellationToken.None); act.ShouldThrow<ObjectDisposedException>(); }
public void GetReadChannelSourceAsync_should_throw_if_disposed() { var subject = new ReadWriteBindingHandle(_readWriteBinding); subject.Dispose(); Action act = () => subject.GetReadChannelSourceAsync(CancellationToken.None); act.ShouldThrow<ObjectDisposedException>(); }
public void GetWriteConnectionSourceAsync_should_throw_if_disposed() { var subject = new ReadWriteBindingHandle(_readWriteBinding); subject.Dispose(); Action act = () => subject.GetWriteConnectionSourceAsync(Timeout.InfiniteTimeSpan, CancellationToken.None); act.ShouldThrow <ObjectDisposedException>(); }
public void Disposing_of_fork_before_disposing_of_subject_hould_not_dispose_of_connectionSource() { var subject = new ReadWriteBindingHandle(_readWriteBinding); var forked = subject.Fork(); forked.Dispose(); _readWriteBinding.DidNotReceive().Dispose(); }
public void Fork_should_throw_if_disposed() { var subject = new ReadWriteBindingHandle(_readWriteBinding); subject.Dispose(); Action act = () => subject.Fork(); act.ShouldThrow <ObjectDisposedException>(); }
public void GetReadChannelSourceAsync_should_throw_if_disposed() { var subject = new ReadWriteBindingHandle(_readWriteBinding); subject.Dispose(); Action act = () => subject.GetReadChannelSourceAsync(CancellationToken.None); act.ShouldThrow <ObjectDisposedException>(); }
public void Disposing_of_last_handle_should_dispose_of_connectioSource() { var subject = new ReadWriteBindingHandle(_mockReadWriteBinding.Object); var forked = subject.Fork(); subject.Dispose(); forked.Dispose(); _mockReadWriteBinding.Verify(b => b.Dispose(), Times.Once); }
public void Disposing_of_last_handle_should_dispose_of_connectioSource() { var subject = new ReadWriteBindingHandle(_readWriteBinding); var forked = subject.Fork(); subject.Dispose(); forked.Dispose(); _readWriteBinding.Received().Dispose(); }
public void Disposing_of_handle_after_fork_should_not_dispose_of_channelSource() { var subject = new ReadWriteBindingHandle(_readWriteBinding); var forked = subject.Fork(); subject.Dispose(); _readWriteBinding.DidNotReceive().Dispose(); forked.Dispose(); _readWriteBinding.Received().Dispose(); }
public void Disposing_of_fork_before_disposing_of_subject_hould_not_dispose_of_channelSource() { var subject = new ReadWriteBindingHandle(_mockReadWriteBinding.Object); var forked = subject.Fork(); forked.Dispose(); _mockReadWriteBinding.Verify(b => b.Dispose(), Times.Never); subject.Dispose(); _mockReadWriteBinding.Verify(b => b.Dispose(), Times.Once); }
public void GetReadChannelSource_should_delegate_to_reference( [Values(false, true)] bool async) { var subject = new ReadWriteBindingHandle(_mockReadWriteBinding.Object); if (async) { subject.GetReadChannelSourceAsync(CancellationToken.None).GetAwaiter().GetResult(); _mockReadWriteBinding.Verify(b => b.GetReadChannelSourceAsync(CancellationToken.None), Times.Once); } else { subject.GetReadChannelSource(CancellationToken.None); _mockReadWriteBinding.Verify(b => b.GetReadChannelSource(CancellationToken.None), Times.Once); } }
public void GetReadChannelSource_should_delegate_to_reference( [Values(false, true)] bool async) { var subject = new ReadWriteBindingHandle(_readWriteBinding); if (async) { subject.GetReadChannelSourceAsync(CancellationToken.None).GetAwaiter().GetResult(); _readWriteBinding.Received().GetReadChannelSourceAsync(CancellationToken.None); } else { subject.GetReadChannelSource(CancellationToken.None); _readWriteBinding.Received().GetReadChannelSource(CancellationToken.None); } }
public void GetReadChannelSource_should_throw_if_disposed( [Values(false, true)] bool async) { var subject = new ReadWriteBindingHandle(_mockReadWriteBinding.Object); subject.Dispose(); Action act; if (async) { act = () => subject.GetReadChannelSourceAsync(CancellationToken.None).GetAwaiter().GetResult(); } else { act = () => subject.GetReadChannelSource(CancellationToken.None); } act.ShouldThrow<ObjectDisposedException>(); }
public void GetWriteChannelSource_should_throw_if_disposed( [Values(false, true)] bool async) { var subject = new ReadWriteBindingHandle(_readWriteBinding); subject.Dispose(); Action act; if (async) { act = () => subject.GetWriteChannelSourceAsync(CancellationToken.None).GetAwaiter().GetResult(); } else { act = () => subject.GetWriteChannelSource(CancellationToken.None); } act.ShouldThrow <ObjectDisposedException>(); }
public void Disposing_of_handle_after_fork_should_not_dispose_of_connectionSource() { var subject = new ReadWriteBindingHandle(_readWriteBinding); var forked = subject.Fork(); subject.Dispose(); _readWriteBinding.DidNotReceive().Dispose(); }
public void Disposing_of_fork_before_disposing_of_subject_hould_not_dispose_of_channelSource() { var subject = new ReadWriteBindingHandle(_readWriteBinding); var forked = subject.Fork(); forked.Dispose(); _readWriteBinding.DidNotReceive().Dispose(); subject.Dispose(); _readWriteBinding.Received().Dispose(); }
public void Fork_should_throw_if_disposed() { var subject = new ReadWriteBindingHandle(_mockReadWriteBinding.Object); subject.Dispose(); Action act = () => subject.Fork(); act.ShouldThrow<ObjectDisposedException>(); }