Exemple #1
0
        public void Styles_ShouldReturnOptionSetup()
        {
            var commandParser = A.Fake <CommandParser <DataTypesCommandOptions> >();

            var targetProperty = typeof(DataTypesCommandOptions).GetProperty("Decimals");
            var optionParser   = A.Fake <DecimalListOptionParser>(ob => ob.WithArgumentsForConstructor(() => new DecimalListOptionParser(targetProperty, "decimals")));

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

            setup.Styles(NumberStyles.Currency).Should().Be(setup);
        }
Exemple #2
0
        public void Styles_ShouldAssignStylesToOptionParser()
        {
            var commandParser = A.Fake <CommandParser <DataTypesCommandOptions> >();

            var targetProperty = typeof(DataTypesCommandOptions).GetProperty("Decimals");
            var optionParser   = A.Fake <DecimalListOptionParser>(ob => ob.WithArgumentsForConstructor(() => new DecimalListOptionParser(targetProperty, "decimals")));

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

            setup.Styles(NumberStyles.Currency);

            A.CallToSet(() => optionParser.NumberStyles).To(NumberStyles.Currency).MustHaveHappened();
        }