Ejemplo n.º 1
0
        public void Parse_sequence_verb_returns_verb_instance()
        {
            // Fixture setup
            var expected = new SequenceOptions {
                LongSequence = new long[] { }, StringSequence = new[] { "aa", "b" }
            };

            // Exercize system
            var result = InvokeChoose(
                new[] { typeof(Add_Verb), typeof(Commit_Verb), typeof(Clone_Verb), typeof(SequenceOptions) },
                new[] { "sequence", "-s", "aa", "b" });

            // Verify outcome
            Assert.IsType <SequenceOptions>(((Parsed <object>)result).Value);
            expected.ShouldBeEquivalentTo(((Parsed <object>)result).Value);
            // Teardown
        }
Ejemplo n.º 2
0
        public void Parse_sequence_verb_with_separator_returns_verb_instance(string[] arguments, string[] expectedString)
        {
            // Fixture setup
            var expected = new SequenceOptions {
                LongSequence = new long[] { }, StringSequence = expectedString
            };

            // Exercize system
            var result = InvokeChoose(
                new[] { typeof(Add_Verb), typeof(Commit_Verb), typeof(Clone_Verb), typeof(SequenceOptions) },
                arguments);

            // Verify outcome
            Assert.IsType <SequenceOptions>(((Parsed <object>)result).Value);
            expected.ShouldBeEquivalentTo(((Parsed <object>)result).Value);
            // Teardown
        }
Ejemplo n.º 3
0
        public void Parse_sequence_verb_with_separator_returns_verb_instance(string[] arguments, string[] expectedString)
        {
            // Fixture setup
            var expected = new SequenceOptions {
                LongSequence = new long[] { }, StringSequence = expectedString
            };

            // Exercize system
            var result = InstanceChooser.Choose(
                new[] { typeof(AddOptions), typeof(CommitOptions), typeof(CloneOptions), typeof(SequenceOptions) },
                arguments,
                StringComparer.Ordinal,
                CultureInfo.InvariantCulture);

            // Verify outcome
            Assert.IsType <SequenceOptions>(result.Value);
            expected.ShouldBeEquivalentTo(result.Value);
            // Teardown
        }
Ejemplo n.º 4
0
        public void Parse_sequence_verb_returns_verb_instance()
        {
            // Fixture setup
            var expected = new SequenceOptions {
                LongSequence = new long[] { }, StringSequence = new[] { "aa", "b" }
            };

            // Exercize system
            var result = InstanceChooser.Choose(
                new[] { typeof(Add_Verb), typeof(Commit_Verb), typeof(Clone_Verb), typeof(SequenceOptions) },
                new[] { "sequence", "-s", "aa", "b" },
                StringComparer.Ordinal,
                CultureInfo.InvariantCulture,
                Enumerable.Empty <ErrorType>());

            // Verify outcome
            Assert.IsType <SequenceOptions>(((Parsed <object>)result).Value);
            expected.ShouldBeEquivalentTo(((Parsed <object>)result).Value);
            // Teardown
        }