public void Parse_to_type_with_single_string_ctor_builds_up_correct_instance() { // Fixture setup var expectedResult = new Options_With_Uri_And_SimpleType { EndPoint = new Uri("http://localhost/test/"), MyValue = new MySimpleType("custom-value") }; // Exercize system var result = InvokeBuild <Options_With_Uri_And_SimpleType>( new[] { "--endpoint=http://localhost/test/", "custom-value" }); // Verify outcome expectedResult.Should().BeEquivalentTo(((Parsed <Options_With_Uri_And_SimpleType>)result).Value); // Teardown }
public static void Parse_to_type_with_single_string_ctor_builds_up_correct_instance() { // Fixture setup var expectedResult = new Options_With_Uri_And_SimpleType { EndPoint = new Uri("http://localhost/test/"), MyValue = new MySimpleType("custom-value") }; // Exercize system var result = InstanceBuilder.Build( Maybe.Just <Func <Options_With_Uri_And_SimpleType> >(() => new Options_With_Uri_And_SimpleType()), new[] { "--endpoint=http://localhost/test/", "custom-value" }, StringComparer.Ordinal, CultureInfo.InvariantCulture, Enumerable.Empty <ErrorType>()); // Verify outcome expectedResult.ShouldBeEquivalentTo(((Parsed <Options_With_Uri_And_SimpleType>)result).Value); // Teardown }