Nov 12, 2025 · 2 min read · Since InsertArtUseCase and DeleteArtUseCase are pure domain logic, they’re easy to test — no Android dependencies, just Kotlin coroutines and a fake repository. Let’s write clear, minimal, and clean unit tests using JUnit + Kotlin coroutines test. We...
Join discussionNov 9, 2025 · 1 min read · Let us update the ArtUseCases class. data class ArtUseCases( val getArtUseCase: GetArtUseCase, val searchImageUseCase: SearchImageUseCase, val insertArtUseCase: InsertArtUseCase, val deleteArtUseCase:DeleteArtUseCase ) We will now cod...
Join discussionNov 2, 2025 · 4 min read · data class SearchImageUiState( val isLoading: Boolean = false, val errorMessage: String? = null, val searchResults: List<String> = emptyList() ) /** * ## ArtViewModel (Simplified Version) * * This ViewModel is responsible for fetching...
Join discussionNov 1, 2025 · 3 min read · Now we will code the class ArtViewModelTest, which validates that the ArtViewModel in chapter 10 correctly collects and exposes data from the domain layer (via the GetArtUseCase). package com.learning.artsnapapp.presentation.viewmodel import app.cas...
Join discussionOct 27, 2025 · 2 min read · Now since it is clear that we have three layers to deal with for every use case, we will now create the folders in the Android project folder. We are using Android studio to code this application. Note: - I am not including “How to use Android studio...
Join discussion