Beispiel #1
0
        public ICommandParser CreateSut(string command = null, ICommandParserImplementation impl = null)
        {
            command ??= "";
            impl ??= Substitute.For <ICommandParserImplementation>();

            return(new CommandParser(command, impl));
        }
Beispiel #2
0
        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;
        }