Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: test/Notification.cpp

Issue 5068192028295168: Issue 1919 - add Notifications::GetLinks() (Closed)
Patch Set: get rid of c++11 Created Feb. 2, 2015, 2:51 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/Notification.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/Notification.cpp
===================================================================
--- a/test/Notification.cpp
+++ b/test/Notification.cpp
@@ -169,3 +169,23 @@
notification->MarkAsShown();
EXPECT_EQ(NULL, filterEngine->GetNextNotificationToShow().get());
}
+
+TEST_F(NotificationTest, NoLinks)
+{
+ AddNotification("{ id: 'id'}");
+ NotificationPtr notification = filterEngine->GetNextNotificationToShow();
+ ASSERT_TRUE(notification);
+ std::vector<std::string> notificationLinks = notification->GetLinks();
+ EXPECT_EQ(0, notificationLinks.size());
+}
+
+TEST_F(NotificationTest, Links)
+{
+ AddNotification("{ id: 'id', links: ['link1', 'link2'] }");
+ NotificationPtr notification = filterEngine->GetNextNotificationToShow();
+ ASSERT_TRUE(notification);
+ std::vector<std::string> notificationLinks = notification->GetLinks();
+ ASSERT_EQ(2, notificationLinks.size());
+ EXPECT_EQ("link1", notificationLinks[0]);
+ EXPECT_EQ("link2", notificationLinks[1]);
+}
« no previous file with comments | « src/Notification.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld