Exemplo n.º 1
0
        public InlineKeyboardBuilder AddOpenUrl(string buttonText, string url, OpenMode openMode = OpenMode.Webview, string description = null, string callbackDataTrigger = null)
        {
            InlineKeyboardItem item = InlineKeyboardItem.OpenUrl(buttonText, url, openMode, description, callbackDataTrigger);

            rowItems.Add(item);

            return(this);
        }
Exemplo n.º 2
0
        public void Inline_keyboard_serialization_must_be_equal_to_expected()
        {
            InlineKeyboard inlineKeyboard = new InlineKeyboard();

            inlineKeyboard.AddRow(new List <InlineKeyboardItem>()
            {
                InlineKeyboardItem.Simple("simple button", "btnSmpTapped"),
                InlineKeyboardItem.Payment("payment", 5000, "GUID/refId", "give me that.."),
                InlineKeyboardItem.OpenUrl("bing", "https://bing.com")
            });

            string result   = Utils.Serialize(inlineKeyboard).Replace(" ", "").ToLower();
            string expected = Utils.ReadFile(JsonsDirectory + "text\\inlineKeyboard.txt").Replace("\n", "").Replace("\r", "").Replace(" ", "").ToLower();

            result.Should().Be(expected);
        }