Skip to content

Commit 1ea827f

Browse files
committed
Uploaded action versions
1 parent 8e165bd commit 1ea827f

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import kotlinx.coroutines.runBlocking
2+
import recipeimporter.RecipeImporter
3+
import recipeimporter.model.Recipe
4+
import kotlin.test.Test
5+
import kotlin.test.assertNotNull
6+
7+
class RecipeImporterSingleUrlTest {
8+
9+
@Test
10+
fun testSingleRecipe() = runBlocking {
11+
val url = System.getProperty("singleRecipeUrl")
12+
?: throw IllegalArgumentException("No singleRecipeUrl property passed to the test")
13+
14+
println("Importing recipe from: $url")
15+
16+
val recipe: Recipe? = RecipeImporter.importFromUrl(url)
17+
assertNotNull(recipe, "Failed to import recipe from $url")
18+
19+
println("Recipe title: ${recipe.title}")
20+
println("Ingredients: ${recipe.ingredients.joinToString()}")
21+
println("Instructions: ${recipe.recipeInstructions.joinToString { it.toString() }}")
22+
}
23+
}

0 commit comments

Comments
 (0)