forked from GoogleCloudPlatform/golang-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.go
36 lines (30 loc) · 914 Bytes
/
package.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright 2011 Google Inc. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.
// [START package_example_1]
package newsletter
import (
"reflect"
"testing"
"google.golang.org/appengine/mail"
)
func TestComposeNewsletter(t *testing.T) {
want := &mail.Message{
Sender: "newsletter@appspot.com",
To: []string{"User <user@example.com>"},
Subject: "Weekly App Engine Update",
Body: "Don't forget to test your code!",
}
if msg := composeNewsletter(); !reflect.DeepEqual(msg, want) {
t.Errorf("composeMessage() = %+v, want %+v", msg, want)
}
}
// [END package_example_1]
func composeNewsletter() *mail.Message {
return &mail.Message{
Sender: "newsletter@appspot.com",
To: []string{"User <user@example.com>"},
Subject: "Weekly App Engine Update",
Body: "Don't forget to test your code!",
}
}