public void Name_ShouldReturnCommandSetup() { var parser = A.Fake <Parser>(); var commandParser = A.Fake <CommandParser <Command1Options> >(); A.CallTo(() => parser.CanCommandParserUseCommandName(commandParser, "name")).Returns(true); var setup = new NamedCommandSetup <Command1Options>(parser, commandParser); setup.Name("name").Should().Be(setup); }
public void Name_ShouldAssignNameToCommandParser() { var parser = A.Fake <Parser>(); var commandParser = A.Fake <CommandParser <Command1Options> >(); A.CallTo(() => parser.CanCommandParserUseCommandName(commandParser, "newCommandName")).Returns(true); var setup = new NamedCommandSetup <Command1Options>(parser, commandParser); setup.Name("newCommandName"); A.CallToSet(() => commandParser.CommandName).To("newCommandName").MustHaveHappened(); }