Example #1
0
        public void Pin_Unpin_ChatMessage_Returns()
        {
            var channelMessage = _b.SendMessage(_testChannelPost.Chat, "pinned message");
            var privateMessage = _b.SendMessage(_testMessage.Chat, "pinning this should fail");

            Assert.That(_b.PinChatMessage(channelMessage));
            Assert.That(_b.UnpinChatMessage(channelMessage.Chat));
            //reaction on no present message
            Assert.Throws <WebException>(() => _b.UnpinChatMessage(channelMessage.Chat));

            Assert.Throws <WebException>(() => _b.PinChatMessage(privateMessage));

            //reaction on unpinnin in private chat
            Assert.Throws <WebException>(() => _b.UnpinChatMessage(privateMessage.Chat));
        }