Exemplo n.º 1
0
        public void SecondAbaIsDetected()
        {
            var address   = new Ip7Address(new[] { new Ip7Sequence("zazbz", false), new Ip7Sequence("bzb", true), new Ip7Sequence("cdb", false) });
            var inspector = new AddressInspector();

            Assert.True(inspector.DetectSsl(address));
        }
Exemplo n.º 2
0
        public void AbaAndBabMeansSsl()
        {
            var address   = new Ip7Address(new [] { new Ip7Sequence("aba", false), new Ip7Sequence("bab", true), new Ip7Sequence("xyz", false) });
            var inspector = new AddressInspector();

            Assert.True(inspector.DetectSsl(address));
        }
Exemplo n.º 3
0
        public void AbaAndAbaMeansNoSsl()
        {
            var address   = new Ip7Address(new[] { new Ip7Sequence("xyx", false), new Ip7Sequence("xyx", true), new Ip7Sequence("xyx", false) });
            var inspector = new AddressInspector();

            Assert.False(inspector.DetectSsl(address));
        }
Exemplo n.º 4
0
        public string Solve(string[] input)
        {
            var parser    = new AddressParser();
            var ips       = input.Select(line => parser.Parse(line));
            var inspector = new AddressInspector();

            return(ips.Count(ip => inspector.DetectSsl(ip)).ToString());
        }