Skip to content

Commit c0a79b6

Browse files
committed
Add feed id tests
1 parent 61bec52 commit c0a79b6

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import 'package:stream_feeds/stream_feeds.dart';
2+
import 'package:test/test.dart';
3+
4+
void main() {
5+
test('feed id should be created with group and id', () {
6+
const feedId = FeedId(group: 'group', id: 'id');
7+
expect(feedId.group, 'group');
8+
expect(feedId.id, 'id');
9+
expect(feedId.rawValue, 'group:id');
10+
});
11+
12+
test('feed id should be created with timeline group and id', () {
13+
const feedId = FeedId.timeline('id');
14+
expect(feedId.group, 'timeline');
15+
expect(feedId.id, 'id');
16+
expect(feedId.rawValue, 'timeline:id');
17+
});
18+
19+
test('feed id should be created with notification group and id', () {
20+
const feedId = FeedId.notification('id');
21+
expect(feedId.group, 'notification');
22+
expect(feedId.id, 'id');
23+
expect(feedId.rawValue, 'notification:id');
24+
});
25+
26+
test('feed id should be created with stories group and id', () {
27+
const feedId = FeedId.stories('id');
28+
expect(feedId.group, 'stories');
29+
expect(feedId.id, 'id');
30+
expect(feedId.rawValue, 'stories:id');
31+
});
32+
33+
test('feed id should be created with story group and id', () {
34+
const feedId = FeedId.story('id');
35+
expect(feedId.group, 'story');
36+
expect(feedId.id, 'id');
37+
expect(feedId.rawValue, 'story:id');
38+
});
39+
40+
test('feed id should be created with user group and id', () {
41+
const feedId = FeedId.user('id');
42+
expect(feedId.group, 'user');
43+
expect(feedId.id, 'id');
44+
expect(feedId.rawValue, 'user:id');
45+
});
46+
}

0 commit comments

Comments
 (0)