< Summary - ReFlex - Library

Information
Class: ReFlex.Core.Common.Adapter.TcpClientAdapter
Assembly: ReFlex.Core.Common
File(s): D:\a\reflex\reflex\library\src\Core\Common\Adapter\TcpClientAdapter.cs
Line coverage
23%
Covered lines: 4
Uncovered lines: 13
Coverable lines: 17
Total lines: 37
Line coverage: 23.5%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor()100%11100%
get_Connected()100%210%
ConnectAsync()100%210%
GetStream()100%210%
Close()100%210%
Dispose()100%210%

File(s)

D:\a\reflex\reflex\library\src\Core\Common\Adapter\TcpClientAdapter.cs

#LineLine coverage
 1using System.Net.Sockets;
 2using System.Threading.Tasks;
 3using ReFlex.Core.Common.Interfaces;
 4
 5namespace ReFlex.Core.Common.Adapter
 6{
 7    public class TcpClientAdapter : ITcpClient
 8    {
 9        private readonly TcpClient _client;
 10
 411        public TcpClientAdapter()
 412        {
 413            _client = new TcpClient();
 414        }
 15
 016        public bool Connected => _client.Connected;
 17        public async Task ConnectAsync(string hostname, int port)
 018        {
 019            await _client.ConnectAsync(hostname, port);
 020        }
 21
 22        public NetworkStream GetStream()
 023        {
 024            return _client.GetStream();
 025        }
 26
 27        public void Close()
 028        {
 029            _client.Close();
 030        }
 31
 32        public void Dispose()
 033        {
 034            _client.Dispose();
 035        }
 36    }
 37}