public void Prompt_NameUpperCase() { var options = new PromptOptions(new List <PromptOption>() { new PromptOption("Yes", 'y'), }); Assert.AreEqual("[y]es", options.ToString()); }
public void Prompt_DefaultChoice() { var options = new PromptOptions(new List <PromptOption>() { new PromptOption("yes"), new PromptOption("no") }, 'n'); Assert.AreEqual("[y]es | [N]o", options.ToString()); }
public void Prompt_KeyNotPartOfName() { var options = new PromptOptions(new List <PromptOption>() { new PromptOption("ja", 'y'), new PromptOption("nein", 'n'), }); Assert.AreEqual("ja [y] | [n]ein", options.ToString()); }
public void Select_ReturnFunctionOutput() { var name = "Output"; var options = new PromptOptions(new List <PromptOption>() { new PromptOption("upper case", () => name.ToUpper()) }); Assert.AreEqual("[u]pper case", options.ToString()); Assert.AreEqual("OUTPUT", options.Select('u')); }
public void Prompt_NoDefaultChoice() { var options = new PromptOptions(new List <PromptOption>() { new PromptOption("yes"), new PromptOption("no") }); Assert.AreEqual("[y]es | [n]o", options.ToString()); Assert.AreEqual(null, options.DefaultOption); }