generated from Coding-Cuddles/bootstrap-cpp-kata
-
Notifications
You must be signed in to change notification settings - Fork 1
/
test_media_player.cpp
36 lines (30 loc) · 1.05 KB
/
test_media_player.cpp
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
#include <gmock/gmock.h>
#include "media_player.h"
TEST(AudioPlayerTest, PlayAudio)
{
AudioPlayer audio_player;
EXPECT_NO_THROW(audio_player.play_audio());
EXPECT_THROW(audio_player.display_video(), std::logic_error);
EXPECT_THROW(audio_player.view_image(), std::logic_error);
}
TEST(VideoPlayerTest, DisplayVideo)
{
VideoPlayer videoPlayer;
EXPECT_NO_THROW(videoPlayer.display_video());
EXPECT_THROW(videoPlayer.play_audio(), std::logic_error);
EXPECT_THROW(videoPlayer.view_image(), std::logic_error);
}
TEST(ImagePlayerTest, ViewImage)
{
ImagePlayer imagePlayer;
EXPECT_NO_THROW(imagePlayer.view_image());
EXPECT_THROW(imagePlayer.play_audio(), std::logic_error);
EXPECT_THROW(imagePlayer.display_video(), std::logic_error);
}
TEST(MediaListPlayerTest, MediaListPlayerPlaysCompatibleList)
{
std::vector<MediaFile> media_list{/* populate media files */};
Players players{/* populate players */};
MediaListPlayer list_player;
EXPECT_NO_THROW(list_player.play_list(media_list, players));
}