public void NoAbbaInNormalMeansNoTls() { var address = new Ip7Address(new[] { new Ip7Sequence("abca", false) }); var inspector = new AddressInspector(); Assert.False(inspector.DetectTls(address)); }
public void AbbaInLongerIsDetected() { var address = new Ip7Address(new[] { new Ip7Sequence("kjhabbaer", false) }); var inspector = new AddressInspector(); Assert.True(inspector.DetectTls(address)); }
public void AbbaInHypernetMeansNoTls() { var address = new Ip7Address(new[] { new Ip7Sequence("abba", false), new Ip7Sequence("xyyx", true), }); var inspector = new AddressInspector(); Assert.False(inspector.DetectTls(address)); }
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.DetectTls(ip)).ToString()); }