public void Validate_ShouldReturnCommandSetup() { var parser = A.Fake <Parser>(); var commandParser = A.Fake <CommandParser <Command1Options> >(ob => ob.WithArgumentsForConstructor(() => new CommandParser <Command1Options>(parser))); var validator = A.Fake <Action <CommandValidatorContext <Command1Options> > >(); var setup = new DefaultCommandSetup <Command1Options>(parser, commandParser); setup.Validate(validator).Should().Be(setup); }
public void Validate_ShouldAssignValidatorToCommandParser() { var parser = A.Fake <Parser>(); var commandParser = A.Fake <CommandParser <Command1Options> >(ob => ob.WithArgumentsForConstructor(() => new CommandParser <Command1Options>(parser))); var validator = A.Fake <Action <CommandValidatorContext <Command1Options> > >(); var setup = new DefaultCommandSetup <Command1Options>(parser, commandParser); setup.Validate(validator); A.CallToSet(() => commandParser.Validator).To(validator).MustHaveHappened(); }