Exemplo n.º 1
0
        public async Task Should_Scan_Registry()
        {
            var resultExpected = new RegistriesScanResult();

            resultExpected.AddRegistryScanResult(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Run", true, true, true);
            resultExpected.AddRegistryScanResult(@"NotExist", false, false, false);

            var result = await _registryScan.ScanAsync();

            result.Should().BeEquivalentTo(resultExpected);
        }
Exemplo n.º 2
0
        public async Task Should_Validate_Ports_Open_And_Close()
        {
            var expectedResult = new PortsScanResult();

            expectedResult.AddPortScanResult(80, true, ProtocolType.Tcp);
            expectedResult.AddPortScanResult(8080, false, ProtocolType.Tcp);
            expectedResult.AddPortScanResult(5939, true, ProtocolType.Tcp);

            var result = (PortsScanResult)await _scan.ScanAsync();

            result.Should().BeEquivalentTo(expectedResult);
        }
        public async Task Should_Scan_Directory()
        {
            var resultExpected = new DirectoriesScanResult();

            resultExpected.AddRegistryScanResult(@"D:\Teste", true, true, true);
            resultExpected.AddRegistryScanResult(@"D:\Teste\A", true, false, true);
            resultExpected.AddRegistryScanResult(@"D:\Teste\B", true, true, false);
            resultExpected.AddRegistryScanResult(@"D:\NotFound", false, false, false);

            var result = (DirectoriesScanResult)await _scan.ScanAsync();

            result.Should().BeEquivalentTo(resultExpected);
        }