In my unit test I am calling the following:
every { connectivityManager.activeNetworkInfo } returns null
but when I debug I get a NetworkInfo object filled with null and false values
networkInfo = {NetworkInfo@9780}"[type: null[null], state: null/null, reason: unspecified), extra: (none), failover: false, available: false, roaming: false]"
therefore this null check in my implementation does not yield false and I cannot verify the "false" path.
val networkInfo = connectivityManager?.activeNetworkInfo
if (networkInfo != null) { ... }
I am calling this deprecated getActiveNetworkInfo() method because I need to support Android 8.0 8.1 and 9.
what am I missing?
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)