Ejemplo n.º 1
0
        public static IDatabaseActionFactory CreateDatabaseActionFactory(InMemoryBotConfigurationContextFactory factory)
        {
            Mock <IDatabaseActionFactory> mockDbActionFactory = new Mock <IDatabaseActionFactory>();

            mockDbActionFactory
            .Setup(dbActionFactory => dbActionFactory.Create())
            .Returns(() => new DatabaseAction(factory.Create()));
            return(mockDbActionFactory.Object);
        }
Ejemplo n.º 2
0
        public async Task PairNewChannelAndUpdateChannel()
        {
            const ulong textChannelId     = 12345;
            const ulong voiceChannelId    = 123456;
            const ulong newVoiceChannelId = 123567;

            using (InMemoryBotConfigurationContextFactory factory = new InMemoryBotConfigurationContextFactory())
                using (BotConfigurationContext context = factory.Create())
                    using (DatabaseAction action = new DatabaseAction(context))
                    {
                        await action.MigrateAsync();

                        await action.PairChannelsAsync(guildId, new (ulong, ulong)[] { (textChannelId, voiceChannelId) });