public ICommandParser CreateSut(string command = null, ICommandParserImplementation impl = null) { command ??= ""; impl ??= Substitute.For <ICommandParserImplementation>(); return(new CommandParser(command, impl)); }
public CommandParser(string command, ICommandParserImplementation impl = null) { command = command ?? throw new ArgumentNullException(nameof(command)); //Used for unit testing, the default behaviour should be to use //_this_ as the implementation _impl = impl ?? this; _impl.Position = -1; _impl.Command = command; }