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); }
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); } }
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); } }