Пример #1
0
        public void Allow_Single_Value_Switches()
        {
            // arrange
            var contextBuilder = new ContextBuilder();
            var parser0        = new Parser <string>("base");
            var builder0       = new ParserBuilder <string>(contextBuilder, parser0);
            var parser1        = new Parser("base");
            var builder1       = new ParserBuilder(contextBuilder, parser1);

            // act
            builder0.WithSingleValueSwitch('h', "help", (o, s) => { });
            builder1.WithSingleValueSwitch('h', "help", (o, s) => { });

            // assert
            builder0.Parser.Parameters.Single().Should().BeAssignableTo <SingleValueSwitch <string> >();
            builder1.Parser.Parameters.Single().Should().BeAssignableTo <SingleValueSwitch>();
        }