public void ParsedArgFactory_WithShortName_IsCorrect() { var factory = ParsedArgFactory.Create <TestOption2>(); Assert.True(factory.ContainsKey("my-bool")); Assert.True(factory.ContainsKey("d")); }
public void ParsedArgFactory_Lookup_IsNotCaseInsensitive() { var testSubject = ParsedArgFactory.Create <TestOption>(); Assert.True(testSubject.ContainsKey("my-bool")); Assert.False(testSubject.ContainsKey("MyBool")); }
public void ParsedArgFactory_Derived_Success() { var factory = ParsedArgFactory.Create <ChildOption>(); Assert.True(factory.ContainsKey("flag")); Assert.True(factory.ContainsKey("help")); }
public void ParsedArgFactory_LongNamePropertyAcrossParsedArgs_IsIdentical() { var factory = ParsedArgFactory.Create <TestOption1>(); var parsedArg1 = factory["donkey"]; var parsedArg2 = factory["d"]; Assert.Equal("donkey", parsedArg1.LongName); Assert.Equal(parsedArg1.LongName, parsedArg2.LongName); }
public void ParsedArgFactory_LookupWithOverriddenName_IsNotCaseInsensitive() { var factory = ParsedArgFactory.Create <TestOption1>(); Assert.False(factory.ContainsKey("MyBool")); Assert.True(factory.ContainsKey("donkey")); Assert.True(factory.ContainsKey("d")); Assert.False(factory.ContainsKey("DonkeY")); Assert.False(factory.ContainsKey("D")); }
public void ParsedArgFactory_Parse_OnlyOptionAttributes() { var testSubject = ParsedArgFactory.Create <TestOption>(); Assert.Equal(5, testSubject.Count); Assert.True(testSubject.ContainsKey("my-bool")); Assert.True(testSubject.ContainsKey("my-int")); Assert.True(testSubject.ContainsKey("my-nullable-int")); Assert.True(testSubject.ContainsKey("my-string1")); Assert.True(testSubject.ContainsKey("my-string2")); }