Esempio n. 1
0
        public async Task CanOpenConversation()
        {
            var config = ConfigFromJsonTests.GetConfig();
            var core   = new PizzaCore(config, new Mock <Serilog.ILogger>().Object);
            await core.Start();

            var users = core.UserCache;
            var user  = users.First(u => u.name == "jarlelin");

            var res = await core.OpenUserConversation(user.id);
        }
Esempio n. 2
0
        public async Task CheckChannelMembers()
        {
            var config = ConfigFromJsonTests.GetConfig();
            var core   = new PizzaCore(config, new Mock <Serilog.ILogger>().Object);
            await core.Start();

            var channel = core.Channels.Single(c => c.name == config.PizzaRoom.Room);

            var members = await core.ChannelMembers(config.PizzaRoom.Room);

            Assert.IsNotEmpty(members);
        }
Esempio n. 3
0
        public async Task CanSendHello()
        {
            var config = ConfigFromJsonTests.GetConfig();
            var core   = new PizzaCore(config, new Mock <Serilog.ILogger>().Object);
            await core.Start();

            var users = core.UserCache;
            var user  = users.First(u => u.name == "jarlelin");

            await core.SendMessage(new Models.SlackModels.MessageToSend {
                UserId = user.id, Text = "test hi"
            });
        }
Esempio n. 4
0
        public async Task SendHelloToUserChannel()
        {
            var config = ConfigFromJsonTests.GetConfig();
            var core   = new PizzaCore(config, new Mock <Serilog.ILogger>().Object);
            await core.Start();

            var users = core.UserCache;
            var user  = users.First(u => u.name == "jarlelin");

            var chan = await core.OpenUserConversation(user.id);

            await core.SendMessage(new Models.SlackModels.MessageToSend {
                ChannelId = chan.id, UserId = user.id, Text = "check my username"
            });
        }