Exemple #1
0
        public ListDirectoryTest()
        {
            var serversMock = new Mock <IDiscordServers>();

            serversMock
            .Setup(s => s.GetChannelNamesFromServer(TestServerId))
            .Returns(new[] { "ChannelA", "ChannelB", "ChannelC" });

            serversMock
            .Setup(s => s.GetServerNameById(TestServerId))
            .Returns(TestServerName);

            _ls = new ListDirectoryProvider(serversMock.Object);
        }
Exemple #2
0
        public ListDirectoryTest()
        {
            var serversMock = new Mock <IDiscordGuilds>();

            serversMock
            .Setup(s => s.FromAsync(It.Is <MiunieUser>(u => u.GuildId == TestServerId)))
            .Returns(Task.FromResult(new MiunieGuild
            {
                ChannelNames = new[] { "ChannelA", "ChannelB", "ChannelC" },
                Id           = TestServerId,
                Name         = TestServerName
            }));

            _ls = new ListDirectoryProvider(serversMock.Object);
        }
Exemple #3
0
 public DirectoryService(IDiscordMessages messages, IListDirectoryProvider directoryProvider)
 {
     _directoryProvider = directoryProvider;
     _messages          = messages;
 }