Skip to content

Commit

Permalink
add Song contains unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
nalgnaohel committed Dec 12, 2024
1 parent 856d240 commit e13c250
Showing 1 changed file with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.example.harmonyhub.components

import com.example.harmonyhub.ui.components.Song
import com.example.harmonyhub.ui.components.contains
import org.junit.Assert.assertEquals
import org.junit.Test

class SongCardTest {
@Test
fun testContains() {
// Test the SongCard
var song = Song("1", "Conditionally", "Katy Perry", "imageResId", "url");
assertEquals(song.contains("Conditionally"), true);
}

@Test
fun testContainsArtist() {
// Test the SongCard
var song = Song("1", "Conditionally", "Katy Perry", "imageResId", "url");
assertEquals(song.contains("Kat"), true);
}

@Test()
fun testNoContains() {
// Test the SongCard
var song = Song("1", "Conditionally", "Katy Perry", "imageResId", "url");
assertEquals(song.contains("Taylor"), false);
}
}

0 comments on commit e13c250

Please sign in to comment.