package com.optix.android.tools.network

import org.junit.Assert.assertEquals
import org.junit.Test

class PortScannerToolTest {

    @Test
    fun commonPorts_containsWellKnownServices() {
        assertEquals("ftp", PortScannerTool.COMMON_PORTS[21])
        assertEquals("ssh", PortScannerTool.COMMON_PORTS[22])
        assertEquals("telnet", PortScannerTool.COMMON_PORTS[23])
        assertEquals("smtp", PortScannerTool.COMMON_PORTS[25])
        assertEquals("dns", PortScannerTool.COMMON_PORTS[53])
        assertEquals("http", PortScannerTool.COMMON_PORTS[80])
        assertEquals("https", PortScannerTool.COMMON_PORTS[443])
        assertEquals("smb", PortScannerTool.COMMON_PORTS[445])
        assertEquals("mysql", PortScannerTool.COMMON_PORTS[3306])
        assertEquals("rdp", PortScannerTool.COMMON_PORTS[3389])
        assertEquals("postgresql", PortScannerTool.COMMON_PORTS[5432])
        assertEquals("redis", PortScannerTool.COMMON_PORTS[6379])
        assertEquals("mongodb", PortScannerTool.COMMON_PORTS[27017])
    }

    @Test
    fun metadata_name_isPortScanner() {
        assertEquals("port_scanner", PortScannerTool().metadata.name)
    }
}
