MCPcopy
hub / github.com/kopia/kopia / TestToString

Function TestToString

notification/sender/notification_message_test.go:82–98  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

80}
81
82func TestToString(t *testing.T) {
83 msg := &sender.Message{
84 Subject: "Test Subject",
85 Headers: map[string]string{
86 "Header1": "Value1",
87 "Header2": "Value2",
88 },
89 Body: "This is the body of the message.",
90 }
91
92 expected := "Subject: Test Subject\nHeader1: Value1\nHeader2: Value2\n\nThis is the body of the message."
93 actual := msg.ToString()
94
95 if actual != expected {
96 t.Errorf("ToString() = %v, want %v", actual, expected)
97 }
98}
99
100func TestValidateMessageFormatAndSetDefault(t *testing.T) {
101 var f string

Callers

nothing calls this directly

Calls 2

ToStringMethod · 0.95
ErrorfMethod · 0.80

Tested by

no test coverage detected