# test_songs.py


from songs import Song, SongCollection
import unittest



class SongCollectionTest(unittest.TestCase):
    def setUp(self):
        self._collection = SongCollection()


    def test_new_collections_have_size_zero(self):
        self.assertEqual(self._collection.size(), 0)


    def test_after_adding_one_song_to_a_collection__size_is_1(self):
        self._collection.add(self._create_test_song())
        self.assertEqual(self._collection.size(), 1)


    def test_continuing_to_add_songs_continues_to_increase_size(self):
        for song_count in range(1, 101):
            self._collection.add(self._create_test_song())
            self.assertEqual(self._collection.size(), song_count)


    def test_after_adding_song_to_collection__collection_contains_song(self):
        new_song = self._create_test_song()
        self._collection.add(new_song)
        self.assertTrue(self._collection.contains(new_song))


    def test_collections_do_not_contain_songs_that_have_not_been_added(self):
        self.assertFalse(self._collection.contains(self._create_test_song()))


    def _create_test_song(self) -> Song:
        return Song()



if __name__ == '__main__':
    unittest.main()
