Example #1
0
        public void Parse_to_immutable_instance()
        {
            // Fixture setup
            var expectedOptions = new FakeImmutableOptions(
                "strvalue", new[] { 1, 2, 3 }, default(bool), default(long));
            var sut = new Parser();

            // Exercize system
            var result = sut.ParseArguments<FakeImmutableOptions>(new[] { "--stringvalue=strvalue", "-i1", "2", "3" });

            // Verify outcome
            result.Value.ShouldBeEquivalentTo(expectedOptions);
            // Teardown
        }
        public void Parse_to_immutable_instance(string[] arguments, FakeImmutableOptions expected)
        {
            // Fixture setup in attributes

            // Exercize system
            var result = InstanceBuilder.Build(
                Maybe.Nothing<Func<FakeImmutableOptions>>(),
                arguments,
                StringComparer.Ordinal,
                CultureInfo.InvariantCulture);

            // Verify outcome
            expected.ShouldBeEquivalentTo(((Parsed<FakeImmutableOptions>)result).Value);

            // Teardown
        }
        #region Methods

        [Theory]
        [MemberData("UnParseDataImmutable")]
        public static void UnParsing_immutable_instance_returns_command_line(FakeImmutableOptions options, string result)
        {