File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments