Пример #1
0
        public void ParsedArgFactory_WithShortName_IsCorrect()
        {
            var factory = ParsedArgFactory.Create <TestOption2>();

            Assert.True(factory.ContainsKey("my-bool"));
            Assert.True(factory.ContainsKey("d"));
        }
Пример #2
0
        public void ParsedArgFactory_Lookup_IsNotCaseInsensitive()
        {
            var testSubject = ParsedArgFactory.Create <TestOption>();

            Assert.True(testSubject.ContainsKey("my-bool"));
            Assert.False(testSubject.ContainsKey("MyBool"));
        }
Пример #3
0
        public void ParsedArgFactory_Derived_Success()
        {
            var factory = ParsedArgFactory.Create <ChildOption>();

            Assert.True(factory.ContainsKey("flag"));
            Assert.True(factory.ContainsKey("help"));
        }
Пример #4
0
        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);
        }
Пример #5
0
        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"));
        }
Пример #6
0
        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"));
        }