public void IsRequired_ShouldReturnOptionSetup() { var commandParser = A.Fake <CommandParser <DataTypesCommandOptions> >(); var targetProperty = typeof(DataTypesCommandOptions).GetProperty("Int64s"); var optionParser = A.Fake <Int64ListOptionParser>(ob => ob.WithArgumentsForConstructor(() => new Int64ListOptionParser(targetProperty, "int64s"))); var setup = new Int64ListOptionSetup <DataTypesCommandOptions>(commandParser, optionParser); setup.IsRequired().Should().Be(setup); }
public void IsRequired_ShouldSetIsRequiredFlagOnOptionParser() { var commandParser = A.Fake <CommandParser <DataTypesCommandOptions> >(); var targetProperty = typeof(DataTypesCommandOptions).GetProperty("Int64s"); var optionParser = A.Fake <Int64ListOptionParser>(ob => ob.WithArgumentsForConstructor(() => new Int64ListOptionParser(targetProperty, "int64s"))); var setup = new Int64ListOptionSetup <DataTypesCommandOptions>(commandParser, optionParser); setup.IsRequired(); A.CallToSet(() => optionParser.IsOptionRequired).To(true).MustHaveHappened(); }