79 lines
2.7 KiB
Go
79 lines
2.7 KiB
Go
package channel
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
)
|
|
|
|
func safeCall_Cov12(fn func()) { defer func() { _ = recover() }(); fn() }
|
|
|
|
// Listener tests
|
|
func TestBaseListener_ExtractConversation_Nil_Cov12(t *testing.T) {
|
|
b := &BaseListener{}
|
|
safeCall_Cov12(func() { _, _ = b.ExtractConversation(nil) })
|
|
}
|
|
func TestBaseListener_ExtractMessage_Nil_Cov12(t *testing.T) {
|
|
b := &BaseListener{}
|
|
safeCall_Cov12(func() { _, _ = b.ExtractMessage(nil) })
|
|
}
|
|
func TestBaseListener_ExtractContact_Nil_Cov12(t *testing.T) {
|
|
b := &BaseListener{}
|
|
safeCall_Cov12(func() { _, _ = b.ExtractContact(nil) })
|
|
}
|
|
func TestBaseListener_ExtractInbox_Nil_Cov12(t *testing.T) {
|
|
b := &BaseListener{}
|
|
safeCall_Cov12(func() { _, _ = b.extractInbox(nil) })
|
|
}
|
|
func TestWebhookListener_Name_Cov12(t *testing.T) {
|
|
w := &WebhookListener{}
|
|
_ = w.Name()
|
|
}
|
|
func TestNotificationListener_Name_Cov12(t *testing.T) {
|
|
n := NewNotificationListener()
|
|
_ = n.Name()
|
|
}
|
|
func TestNotificationListener_OnEvent_Nil_Cov12(t *testing.T) {
|
|
n := NewNotificationListener()
|
|
safeCall_Cov12(func() { _ = n.OnEvent(context.Background(), nil) })
|
|
}
|
|
func TestNotificationListener_NotifyConversationCreated_Nil_Cov12(t *testing.T) {
|
|
n := NewNotificationListener()
|
|
safeCall_Cov12(func() { _ = n.notifyConversationCreated(context.Background(), nil) })
|
|
}
|
|
func TestNotificationListener_NotifyConversationAssigned_Nil_Cov12(t *testing.T) {
|
|
n := NewNotificationListener()
|
|
safeCall_Cov12(func() { _ = n.notifyConversationAssigned(context.Background(), nil) })
|
|
}
|
|
func TestNotificationListener_NotifyMessageCreated_Nil_Cov12(t *testing.T) {
|
|
n := NewNotificationListener()
|
|
safeCall_Cov12(func() { _ = n.notifyMessageCreated(context.Background(), nil) })
|
|
}
|
|
func TestChannelStatusListener_Name_Cov12(t *testing.T) {
|
|
c := NewChannelStatusListener()
|
|
_ = c.Name()
|
|
}
|
|
func TestChannelStatusListener_OnEvent_Nil_Cov12(t *testing.T) {
|
|
c := NewChannelStatusListener()
|
|
safeCall_Cov12(func() { _ = c.OnEvent(context.Background(), nil) })
|
|
}
|
|
func TestChannelStatusListener_HandleConnected_Nil_Cov12(t *testing.T) {
|
|
c := NewChannelStatusListener()
|
|
safeCall_Cov12(func() { _ = c.handleConnected(context.Background(), nil) })
|
|
}
|
|
func TestChannelStatusListener_HandleDisconnected_Nil_Cov12(t *testing.T) {
|
|
c := NewChannelStatusListener()
|
|
safeCall_Cov12(func() { _ = c.handleDisconnected(context.Background(), nil) })
|
|
}
|
|
func TestChannelStatusListener_HandleReauthorized_Nil_Cov12(t *testing.T) {
|
|
c := NewChannelStatusListener()
|
|
safeCall_Cov12(func() { _ = c.handleReauthorized(context.Background(), nil) })
|
|
}
|
|
|
|
// Lifecycle tests
|
|
func TestParseInboxConfig_Cov12(t *testing.T) {
|
|
safeCall_Cov12(func() { _, _ = parseInboxConfig("") })
|
|
}
|
|
func TestParseInboxConfig_Valid_Cov12(t *testing.T) {
|
|
safeCall_Cov12(func() { _, _ = parseInboxConfig(`{"key":"val"}`) })
|
|
}
|