Ejemplo n.º 1
0
        public void Styles_ShouldReturnOptionSetup()
        {
            var commandParser = A.Fake <CommandParser <DataTypesCommandOptions> >();

            var targetProperty = typeof(DataTypesCommandOptions).GetProperty("TimeSpans");
            var optionParser   = A.Fake <TimeSpanListOptionParser>(ob => ob.WithArgumentsForConstructor(() => new TimeSpanListOptionParser(targetProperty, "timeSpans")));

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

            setup.Styles(TimeSpanStyles.AssumeNegative).Should().Be(setup);
        }
Ejemplo n.º 2
0
        public void Styles_ShouldAssignStylesToOptionParser()
        {
            var commandParser = A.Fake <CommandParser <DataTypesCommandOptions> >();

            var targetProperty = typeof(DataTypesCommandOptions).GetProperty("TimeSpans");
            var optionParser   = A.Fake <TimeSpanListOptionParser>(ob => ob.WithArgumentsForConstructor(() => new TimeSpanListOptionParser(targetProperty, "timeSpans")));

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

            setup.Styles(TimeSpanStyles.AssumeNegative);

            A.CallToSet(() => optionParser.TimeSpanStyles).To(TimeSpanStyles.AssumeNegative).MustHaveHappened();
        }