public void EmptyFileName()
        {
            _handler.Handle(string.Empty);

            // Call to Upload.
            _logger.Received(1).LogExec(Arg.Any <Expression <Func <bool> > >());
            // Error logging.
            _logger.Received(1).LogInfo(FileUploadHandler.EmptyFileNameErrMsg);
            Assert.That(_handler.IsHandled, Is.False);
        }
Exemplo n.º 2
0
 private static bool Upload(UploadCmdArgs args, ILogger logger)
 {
     using (var handler = new FileUploadHandler(args.Owner, logger, TimeSpan.FromSeconds(args.Timeout)))
     {
         handler.Handle(args.Path);
         return(handler.IsHandled);
     }
 }
Exemplo n.º 3
0
        public async Task HandleMessage(SocketMessage messageParam)
        {
            var user = ((messageParam as SocketUserMessage)?.Author as SocketGuildUser);

            if (user == null)
            {
                return;
            }

            if (messageParam.Attachments.Any())
            {
                await _fileUploadHandler.Handle(messageParam);
            }
        }