private string GenerateCode() { using var dice = new Diceware(); var pass = dice.Create(5, language: Language.English, separator: '-'); return(pass); }
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); }
public void Diceware_Generated_Throws_Argument_Exception_If_Number_Of_Words_Zero() => Assert.Throws <ArgumentException>(() => generator.Create(0));