public void DefaultValue_ShouldReturnOptionSetup() { var commandParser = A.Fake <CommandParser <DataTypesCommandOptions> >(); var targetProperty = typeof(DataTypesCommandOptions).GetProperty("String"); var optionParser = A.Fake <StringOptionParser>(ob => ob.WithArgumentsForConstructor(() => new StringOptionParser(targetProperty, "string"))); var setup = new StringOptionSetup <DataTypesCommandOptions>(commandParser, optionParser); setup.DefaultValue("newDefaultValue").Should().Be(setup); }
public void DefaultValue_ShouldAssignDefaultValueToOptionParser() { var commandParser = A.Fake <CommandParser <DataTypesCommandOptions> >(); var targetProperty = typeof(DataTypesCommandOptions).GetProperty("String"); var optionParser = A.Fake <StringOptionParser>(ob => ob.WithArgumentsForConstructor(() => new StringOptionParser(targetProperty, "string"))); var setup = new StringOptionSetup <DataTypesCommandOptions>(commandParser, optionParser); var defaultValue = "newDefaultValue"; setup.DefaultValue(defaultValue); A.CallToSet(() => optionParser.OptionDefaultValue).To(defaultValue).MustHaveHappened(); }