示例#1
0
        public void DefaultValue_ShouldReturnOptionSetup()
        {
            var commandParser = A.Fake <CommandParser <DataTypesCommandOptions> >();

            var targetProperty = typeof(DataTypesCommandOptions).GetProperty("Int64");
            var optionParser   = A.Fake <Int64OptionParser>(ob => ob.WithArgumentsForConstructor(() => new Int64OptionParser(targetProperty, "int64")));

            var setup = new Int64OptionSetup <DataTypesCommandOptions>(commandParser, optionParser);

            setup.DefaultValue(123L).Should().Be(setup);
        }
示例#2
0
        public void DefaultValue_ShouldAssignDefaultValueToOptionParser()
        {
            var commandParser = A.Fake <CommandParser <DataTypesCommandOptions> >();

            var targetProperty = typeof(DataTypesCommandOptions).GetProperty("Int64");
            var optionParser   = A.Fake <Int64OptionParser>(ob => ob.WithArgumentsForConstructor(() => new Int64OptionParser(targetProperty, "int64")));

            var setup = new Int64OptionSetup <DataTypesCommandOptions>(commandParser, optionParser);

            var defaultValue = 123L;

            setup.DefaultValue(defaultValue);

            A.CallToSet(() => optionParser.OptionDefaultValue).To(defaultValue).MustHaveHappened();
        }