Example #1
0
        public void DecodeWithBackingTest()
        {
            var parser = new CommandLineParser();

            foreach (var backingOptions in OptionsHelpers.OptionPermutations())
            {
                foreach (var options in OptionsHelpers.OptionPermutations())
                {
                    var opts = new List <string>();
                    if (options.Wrap != backingOptions.Wrap)
                    {
                        opts.Add(options.Wrap ? "+w" : "-w");
                    }

                    if (options.Jump != backingOptions.Jump)
                    {
                        opts.Add(options.Jump ? "+j" : "-j");
                    }

                    if (options.Rescale != backingOptions.Rescale)
                    {
                        opts.Add(options.Rescale ? "+r" : "-r");
                    }

                    if (options.Unstick != backingOptions.Unstick)
                    {
                        opts.Add(options.Unstick ? "+s" : "-s");
                    }
                    OptionsHelpers.Compare(options, parser.Decode(opts, backingOptions));
                }
            }
        }
Example #2
0
        public void RoundTripTest()
        {
            var writer = new OptionsWriter(_optionsFileName);

            DeleteAllWriterFiles();


            foreach (var options in OptionsHelpers.OptionPermutations())
            {
                writer.Write(options);
                var actual = writer.Read();
                OptionsHelpers.Compare(options, actual);
            }
        }
Example #3
0
        public void DecodeTest()
        {
            var parser = new CommandLineParser();

            foreach (var options in OptionsHelpers.OptionPermutations())
            {
                var opts = new List <string>();
                opts.Add(options.Wrap ? "+w" : "-w");
                opts.Add(options.Jump ? "+j" : "-j");
                opts.Add(options.Rescale ? "+r" : "-r");
                opts.Add(options.Unstick ? "+s" : "-s");

                OptionsHelpers.Compare(options, parser.Decode(opts));
            }
        }