Exemplo n.º 1
0
        public async Task RunAsync_ShouldThrowException_IfInvalidToken()
        {
            var config  = Mock.Of <IBotConfiguration>(c => c.DiscordToken == "ObviouslyFakeToken");
            var discord = new Mock <MiunieDiscordClient>(config);

            var miunie = new MiunieDiscord(discord.Object, null, null, null);

            var ex = await Record.ExceptionAsync(async() => await miunie.RunAsync(new CancellationToken()));

            Assert.NotNull(ex);
        }
Exemplo n.º 2
0
 public async Task StartAsync()
 {
     _tokenSource = new CancellationTokenSource();
     await MiunieDiscord.RunAsync(_tokenSource.Token);
 }