public AccountsModule( MikiApp app, Config config, IDiscordClient discordClient, AccountService accountsService, AchievementService achievementService, AchievementEvents achievementEvents, TransactionEvents transactionEvents) { this.app = app; this.achievementService = achievementService; this.discordClient = discordClient; if (!string.IsNullOrWhiteSpace(config.ImageApiUrl)) { client = new HttpClient(config.ImageApiUrl); } else { Log.Warning("Image API can not be loaded in AccountsModule"); } discordClient.Events.MessageCreate.SubscribeTask(OnMessageCreateAsync); accountsService.OnLocalLevelUp += OnUserLevelUpAsync; accountsService.OnLocalLevelUp += OnLevelUpAchievementsAsync; transactionEvents.OnTransactionComplete += CheckCurrencyAchievementUnlocksAsync; achievementEvents.OnAchievementUnlocked .SubscribeTask(SendAchievementNotificationAsync); achievementEvents.OnAchievementUnlocked .SubscribeTask(CheckAchievementUnlocksAsync); }
public void ResetHarvestData() { Metrics.Clear(); CustomEvents.Clear(); TransactionTraces.Clear(); TransactionEvents.Clear(); ErrorTraces.Clear(); ErrorEvents.Clear(); SpanEvents.Clear(); }
public static String AsText(this TransactionEvents TransactionEvents) { switch (TransactionEvents) { case TransactionEvents.Started: return("Started"); case TransactionEvents.Updated: return("Updated"); case TransactionEvents.Ended: return("Ended"); default: return("Unknown"); } }
public async Task InvalidCurrencyTransferTest() { var unit = NewContext(); var userService = new UserService(unit, null); // TODO: replace with better testing solution. bool ranCallback = false; var events = new TransactionEvents(); events.OnTransactionFailed += (a, b) => { Assert.IsType <InsufficientCurrencyException>(b); ranCallback = true; return(Task.CompletedTask); }; var service = new TransactionService(userService, events); await Assext.ThrowsRootAsync <InsufficientCurrencyException>( async() => await service.CreateTransactionAsync(new TransactionRequest(2L, 1L, 10))); Assert.True(ranCallback, "TransactionService did not call error event"); }
public void RemoveEventListener(TransactionEvents type, IEventListener listener, bool capture) { }
public void RemoveEventListener(TransactionEvents type, IEventListener listener) { }
public void RemoveEventListener(TransactionEvents type, HtmlEventHandlerWithTarget<Transaction> listener, bool capture) { }
public void RemoveEventListener(TransactionEvents type, HtmlEventHandler listener) { }
public void AddEventListener(TransactionEvents type, IEventListener listener) { }
public void AddEventListener(TransactionEvents type, HtmlEventHandlerWithTarget<Transaction> listener) { }
public void RemoveEventListener(TransactionEvents type, HtmlEventHandler listener, bool capture) { }
public void AddEventListener(TransactionEvents type, Action listener, bool capture) { }
public void AddEventListener(TransactionEvents type, HtmlEventHandlerWithTarget <Transaction> listener, bool capture) { }
public void AddEventListener(TransactionEvents type, HtmlEventHandler listener) { }
public void RemoveEventListener(TransactionEvents type, HtmlEventHandlerWithTarget <Transaction> listener) { }
public TransactionService(IUserService service, [Optional] TransactionEvents events) { this.events = events; this.service = service; }
public void AddEventListener(TransactionEvents type, HtmlEventHandler listener, bool capture) { }
public void AddEventListener(TransactionEvents type, IEventListener listener, bool capture) { }
public void RemoveEventListener(TransactionEvents type, Action listener, bool capture) { }