@@ -230,6 +230,16 @@ func TestSendWithExistingVoice(t *testing.T) {
230230 }
231231}
232232
233+ func TestSendWithContact (t * testing.T ) {
234+ bot , _ := getBot (t )
235+
236+ contact := tgbotapi .NewContact (ChatID , "5551234567" , "Test" )
237+
238+ if _ , err := bot .Send (contact ); err != nil {
239+ t .Fail ()
240+ }
241+ }
242+
233243func TestSendWithLocation (t * testing.T ) {
234244 bot , _ := getBot (t )
235245
@@ -240,6 +250,16 @@ func TestSendWithLocation(t *testing.T) {
240250 }
241251}
242252
253+ func TestSendWithVenue (t * testing.T ) {
254+ bot , _ := getBot (t )
255+
256+ venue := tgbotapi .NewVenue (ChatID , "A Test Location" , "123 Test Street" , 40 , 40 )
257+
258+ if _ , err := bot .Send (venue ); err != nil {
259+ t .Fail ()
260+ }
261+ }
262+
243263func TestSendWithNewVideo (t * testing.T ) {
244264 bot , _ := getBot (t )
245265
@@ -399,6 +419,95 @@ func TestSetWebhookWithoutCert(t *testing.T) {
399419 bot .RemoveWebhook ()
400420}
401421
422+ func TestNewInlineQueryResultArticle (t * testing.T ) {
423+ result := tgbotapi .NewInlineQueryResultArticle ("id" , "title" , "message" )
424+
425+ if result .Type != "article" ||
426+ result .ID != "id" ||
427+ result .Title != "title" ||
428+ result .InputMessageContent .(tgbotapi.InputTextMessageContent ).Text != "message" {
429+ t .Fail ()
430+ }
431+ }
432+
433+ func TestNewInlineQueryResultGIF (t * testing.T ) {
434+ result := tgbotapi .NewInlineQueryResultGIF ("id" , "google.com" )
435+
436+ if result .Type != "gif" ||
437+ result .ID != "id" ||
438+ result .URL != "google.com" {
439+ t .Fail ()
440+ }
441+ }
442+
443+ func TestNewInlineQueryResultMPEG4GIF (t * testing.T ) {
444+ result := tgbotapi .NewInlineQueryResultMPEG4GIF ("id" , "google.com" )
445+
446+ if result .Type != "mpeg4_gif" ||
447+ result .ID != "id" ||
448+ result .URL != "google.com" {
449+ t .Fail ()
450+ }
451+ }
452+
453+ func TestNewInlineQueryResultPhoto (t * testing.T ) {
454+ result := tgbotapi .NewInlineQueryResultPhoto ("id" , "google.com" )
455+
456+ if result .Type != "photo" ||
457+ result .ID != "id" ||
458+ result .URL != "google.com" {
459+ t .Fail ()
460+ }
461+ }
462+
463+ func TestNewInlineQueryResultVideo (t * testing.T ) {
464+ result := tgbotapi .NewInlineQueryResultVideo ("id" , "google.com" )
465+
466+ if result .Type != "video" ||
467+ result .ID != "id" ||
468+ result .URL != "google.com" {
469+ }
470+ }
471+
472+ func TestNewEditMessageText (t * testing.T ) {
473+ edit := tgbotapi .NewEditMessageText (ChatID , ReplyToMessageID , "new text" )
474+
475+ if edit .Text != "new text" ||
476+ edit .BaseEdit .ChatID != ChatID ||
477+ edit .BaseEdit .MessageID != ReplyToMessageID {
478+ t .Fail ()
479+ }
480+ }
481+
482+ func TestNewEditMessageCaption (t * testing.T ) {
483+ edit := tgbotapi .NewEditMessageCaption (ChatID , ReplyToMessageID , "new caption" )
484+
485+ if edit .Caption != "new caption" ||
486+ edit .BaseEdit .ChatID != ChatID ||
487+ edit .BaseEdit .MessageID != ReplyToMessageID {
488+ t .Fail ()
489+ }
490+ }
491+
492+ func TestNewEditMessageReplyMarkup (t * testing.T ) {
493+ markup := tgbotapi.InlineKeyboardMarkup {
494+ InlineKeyboard : [][]tgbotapi.InlineKeyboardButton {
495+ []tgbotapi.InlineKeyboardButton {
496+ tgbotapi.InlineKeyboardButton {Text : "test" },
497+ },
498+ },
499+ }
500+
501+ edit := tgbotapi .NewEditMessageReplyMarkup (ChatID , ReplyToMessageID , markup )
502+
503+ if edit .ReplyMarkup .InlineKeyboard [0 ][0 ].Text != "test" ||
504+ edit .BaseEdit .ChatID != ChatID ||
505+ edit .BaseEdit .MessageID != ReplyToMessageID {
506+ t .Fail ()
507+ }
508+
509+ }
510+
402511func TestUpdatesChan (t * testing.T ) {
403512 bot , _ := getBot (t )
404513
0 commit comments