~chrisppy/go-barefeed

ref: 63fc114fd6c8a8779e44c7042a5c1a6f543a76fb go-barefeed/message_test.go -rw-r--r-- 582 bytes
63fc114fChris Palmer updates from schema 4 months ago
                                                                                
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
package barefeed

import (
	"testing"
	"time"
)

func testMessage(t *testing.T, expected, actual Message) {
	if actual.Created != expected.Created {
		t.Errorf("Expected %v, actual %v", expected.Created, actual.Created)
	}
	if actual.Generator != expected.Generator {
		t.Errorf("Expected %s, actual %s", expected.Generator, actual.Generator)
	}
	testFeeds(t, expected.Feeds, actual.Feeds)
	testEntries(t, expected.Entries, actual.Entries)
}

func getMessage() Message {
	return Message{
		Created:   ToTimestamp(time.Now()),
		Generator: "generated",
		Feeds:     getFeeds(),
	}
}