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

            var targetProperty = typeof(DataTypesCommandOptions).GetProperty("Enums");
            var optionParser   = A.Fake <EnumListOptionParser <LogLevel> >(ob => ob.WithArgumentsForConstructor(() => new EnumListOptionParser <LogLevel>(targetProperty, "enums")));

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

            setup.Help("newHelpText").Should().Be(setup);
        }
示例#2
0
        public void Help_ShouldAssignHelpToOptionParser()
        {
            var commandParser = A.Fake <CommandParser <DataTypesCommandOptions> >();

            var targetProperty = typeof(DataTypesCommandOptions).GetProperty("Enums");
            var optionParser   = A.Fake <EnumListOptionParser <LogLevel> >(ob => ob.WithArgumentsForConstructor(() => new EnumListOptionParser <LogLevel>(targetProperty, "enums")));

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

            setup.Help("newHelpText");

            A.CallToSet(() => optionParser.OptionHelp).To("newHelpText").MustHaveHappened();
        }