コード例 #1
0
ファイル: ParserCommand.cs プロジェクト: cj525/yaclops
        public ParserPositionalParameter AddPositionalParameter(string key, bool isCollection)
        {
            var param = new ParserPositionalParameter(key, isCollection);

            _positionalParameters.Add(param);
            _positionalQueue.Enqueue(param);

            return param;
        }
コード例 #2
0
ファイル: PusherTests.cs プロジェクト: cj525/yaclops
        public void CanPushStringList()
        {
            ParserParameter param = new ParserPositionalParameter("Names", true);
            ParseResult result = new ParseResult();

            result.AddCommandListValue(param, "Fred");
            result.AddCommandListValue(param, "Barney");

            var pusher = new CommandPusher(result);

            var command = new ListCommand();

            pusher.Push(command);

            command.Names.ShouldContain(x => x == "Fred");
            command.Names.ShouldContain(x => x == "Barney");
        }