public void ParseOptionWithArgumentsAndLOV_ThrowsExpcetionIfValueIsNotValid() { //************* GIVEN var test = new LOVOptionDefinitionAttribute("v", "verbosity", description: @"manage output as unique file instead to split it into several ones", mandatory: false, values: new string[] { "A", "B", "C" }); this._Parser = new OptionParser(Option.FromAttribute(test).OnTargetProperty(typeof(string))); //************* WHEN var returnedValue = this._Parser.Parse("--v=DDDDDD"); }
public void ParseOptionWithArgumentsAndLOV_ReturnsTheValueIfIsValid() { //************* GIVEN var test = new LOVOptionDefinitionAttribute("v", "verbosity", description: @"manage output as unique file instead to split it into several ones", mandatory: false, values: new string[] { "A", "B", "C" }); this._Parser = new OptionParser(Option.FromAttribute(test).OnTargetProperty(typeof(string))); //************* WHEN var returnedValue = this._Parser.Parse("--v=A"); //************* ASSERT Assert.IsNotNull(returnedValue); Assert.IsInstanceOfType(returnedValue, typeof(string)); Assert.AreEqual("A", (string)returnedValue); }