public void ReturnCorrectPlaylistIdFromPlayloistName(string expect, string name) { //arragne var conn = SQliteConnectionHelper.CreateMemoryPlaylistTable(); conn.InsertTestData("insert into playlist values ('1','first')"); conn.InsertTestData("insert into playlist values ('2','second')"); var service = new PlaylistDao(conn); //assert var id = service.GetPlaylistIdFromName(name); Assert.AreEqual(expect, id); }
public void ReturnAllPlaylistNamesReturnCorrect() { //Arrange var conn = SQliteConnectionHelper.CreateMemoryPlaylistTable(); conn.InsertTestData("insert into playlist values (1,'first')"); conn.InsertTestData("insert into playlist values (2,'second')"); var service = new PlaylistDao(conn); //act var playlistNames = service.NameOfAllPlaylists(); //assert Assert.AreEqual("first", playlistNames[0]); Assert.AreEqual("second", playlistNames[1]); }