コード例 #1
0
        public void GetConnectionAsync_should_get_connection_from_server()
        {
            var subject = new ServerConnectionSource(_server);

            subject.GetConnectionAsync(Timeout.InfiniteTimeSpan, CancellationToken.None);

            _server.Received().GetConnectionAsync(Timeout.InfiniteTimeSpan, CancellationToken.None);
        }
コード例 #2
0
        public void GetConnectionAsync_should_get_connection_from_server()
        {
            var subject = new ServerConnectionSource(_server);

            subject.GetConnectionAsync(Timeout.InfiniteTimeSpan, CancellationToken.None);

            _server.Received().GetConnectionAsync(Timeout.InfiniteTimeSpan, CancellationToken.None);
        }
コード例 #3
0
        public void GetConnectionAsync_should_throw_if_disposed()
        {
            var subject = new ServerConnectionSource(_server);
            subject.Dispose();

            Action act = () => subject.GetConnectionAsync(Timeout.InfiniteTimeSpan, CancellationToken.None);

            act.ShouldThrow<ObjectDisposedException>();
        }
コード例 #4
0
        public void GetConnectionAsync_should_throw_if_disposed()
        {
            var subject = new ServerConnectionSource(_server);

            subject.Dispose();

            Action act = () => subject.GetConnectionAsync(Timeout.InfiniteTimeSpan, CancellationToken.None);

            act.ShouldThrow <ObjectDisposedException>();
        }