From 8159d6abf29c3618d2a3a7d8084f303d5a057594 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 13 Feb 2015 09:56:22 -0600 Subject: Test stream change base cases --- tests/notifications-test.cc | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'tests/notifications-test.cc') diff --git a/tests/notifications-test.cc b/tests/notifications-test.cc index 2aff7ae..b43b691 100644 --- a/tests/notifications-test.cc +++ b/tests/notifications-test.cc @@ -186,3 +186,31 @@ TEST_F(NotificationsTest, VolumeChanges) { notev = notifications->getNotifications(); ASSERT_EQ(0, notev.size()); } + +TEST_F(NotificationsTest, StreamChanges) { + auto volumeControl = volumeControlMock(); + auto soundService = standardService(volumeControl, playerListMock()); + + /* Set a volume */ + notifications->clearNotifications(); + volume_control_set_volume(volumeControl.get(), 50.0); + loop(50); + auto notev = notifications->getNotifications(); + ASSERT_EQ(1, notev.size()); + + /* Change Streams, no volume change */ + notifications->clearNotifications(); + volume_control_mock_set_mock_stream(VOLUME_CONTROL_MOCK(volumeControl.get()), "alarm"); + volume_control_set_volume(volumeControl.get(), 50.0); + loop(50); + notev = notifications->getNotifications(); + EXPECT_EQ(0, notev.size()); + + /* Change Streams, volume change */ + notifications->clearNotifications(); + volume_control_mock_set_mock_stream(VOLUME_CONTROL_MOCK(volumeControl.get()), "alert"); + volume_control_set_volume(volumeControl.get(), 60.0); + loop(50); + notev = notifications->getNotifications(); + EXPECT_EQ(0, notev.size()); +} -- cgit v1.2.3