예제 #1
0
        private string GenerateCode()
        {
            using var dice = new Diceware();

            var pass = dice.Create(5, language: Language.English, separator: '-');

            return(pass);
        }
예제 #2
0
        public static void Main(string[] args)
        {
            Parser.Default.ParseArguments <Options>(args)
            .MapResult(
                (Options opts) =>
            {
                using var dice = new Diceware();

                var pass = dice.Create(opts.WordCount, opts.Language, opts.Separator);
                Console.WriteLine(pass);

                return(0);
            },
                errs => 1);
        }
예제 #3
0
 public void Diceware_Generated_Throws_Argument_Exception_If_Number_Of_Words_Zero() =>
 Assert.Throws <ArgumentException>(() => generator.Create(0));