public void FlagSegment_with_value_should_return_value() { var segment = new FlagSegment("[-f|flag]"); var match = segment.Match("-f value"); Assert.IsType<NamedValueMatchResult>(match); Assert.Equal("value", (string)((NamedValueMatchResult)match).Value); }
public void FlagSegment_without_value_should_return_true() { var segment = new FlagSegment("[-f|flag]"); var match = segment.Match("-f"); Assert.IsType<NamedValueMatchResult>(match); Assert.Equal(true, (bool) ((NamedValueMatchResult) match).Value); }
public void FlagSegment_should_be_named() { var segment = new FlagSegment("[-f|flag]"); var match = segment.Match("-f value"); Assert.IsType<NamedValueMatchResult>(match); Assert.Equal("flag", ((NamedValueMatchResult)match).Name); }
public void FlagSegment_with_value_should_return_value() { var segment = new FlagSegment("[-f|flag]"); var match = segment.Match("-f value"); Assert.IsType <NamedValueMatchResult>(match); Assert.Equal("value", (string)((NamedValueMatchResult)match).Value); }
public void FlagSegment_without_value_should_return_true() { var segment = new FlagSegment("[-f|flag]"); var match = segment.Match("-f"); Assert.IsType <NamedValueMatchResult>(match); Assert.Equal(true, (bool)((NamedValueMatchResult)match).Value); }
public void FlagSegment_should_be_named() { var segment = new FlagSegment("[-f|flag]"); var match = segment.Match("-f value"); Assert.IsType <NamedValueMatchResult>(match); Assert.Equal("flag", ((NamedValueMatchResult)match).Name); }
public void Should_not_match_flag_segment(string segmentText, string commandText) { var segment = new FlagSegment(segmentText); Assert.Null(segment.Match(commandText)); }
public void Should_not_match_flag_segment(string segmentText, string commandText) { var segment = new FlagSegment(segmentText); Assert.Null(segment.Match(commandText)); }