public AppServiceDomain(IBusinessServiceDomain iBusinessServiceDomain, IBusinessServiceDomainIpAddress iBusinessServiceDomainIpAddress,
                         IBusinessServiceOpenPort iBusinessServiceOpenPort)
 {
     _iBusinessServiceDomain          = iBusinessServiceDomain;
     _iBusinessServiceDomainIpAddress = iBusinessServiceDomainIpAddress;
     _iBusinessServiceOpenPort        = iBusinessServiceOpenPort;
 }
예제 #2
0
        public void TestCheckOpenPorts(bool portAccessible, bool portInResult, string message)
        {
            _moqDataServiceNetwork.Setup(a => a.PortAccessible(It.IsAny <int>(), It.IsAny <string>())).Returns(portAccessible);
            _moqDataServiceOpenPort.Setup(a => a.Create(It.IsAny <EntityOpenPort>())).Returns(Task.FromResult(default(object)));
            var toCheckPorts = new int[] { 80 };

            _iBusinessServiceOpenPort = new BusinessServiceOpenPort(_moqDataServiceNetwork.Object, _moqDataServiceOpenPort.Object, toCheckPorts);

            var domainIpAddress  = new DomainIpAddress();
            var notInResultPorts = toCheckPorts.Except(_iBusinessServiceOpenPort.CheckOpenPorts(domainIpAddress));

            Assert.True((notInResultPorts.Count() == 0) == portInResult, message);
        }