public void FromString(string input, int min, int max, char c)
        {
            var actual = PasswordPolicy.FromString(input);

            Assert.Equal(min, actual.Min);
            Assert.Equal(max, actual.Max);
            Assert.Equal(c, actual.Character);
        }
Ejemplo n.º 2
0
    public List <PasswordData> FormatInput(string[] input)
    {
        var regex = new Regex(@"\d+-\d+\s\w:\s(\w+)");

        return(input
               .Select(x =>
        {
            var match = regex.Match(x);
            var password = match.Groups[1].Value;
            return new PasswordData()
            {
                Policy = PasswordPolicy.FromString(x),
                Password = password
            };
        })
               .ToList());
    }