package com.contentsquare.rn.csq.masking import android.content.Context import com.facebook.react.views.view.ReactViewGroup import io.mockk.mockk import org.junit.Assert.assertEquals import org.junit.Assert.assertNotNull import org.junit.Assert.assertTrue import org.junit.Before import org.junit.Test import org.junit.runner.RunWith import org.robolectric.RobolectricTestRunner import org.robolectric.RuntimeEnvironment @RunWith(RobolectricTestRunner::class) class CSQMaskedViewTest { private lateinit var context: Context private lateinit var underTest: CSQMaskedView @Before fun setup() { context = RuntimeEnvironment.getApplication() underTest = CSQMaskedView(context) } @Test fun `constructor should create CSQMaskedView instance with valid context`() { // Given - setup already done // When - constructor called in setup // Then assertNotNull("CSQMaskedView should be created", underTest) assertEquals("Context should match", context, underTest.context) } @Test fun `CSQMaskedView should extend ReactViewGroup`() { // Given - setup already done // When - checking inheritance // Then assertTrue( "CSQMaskedView should extend ReactViewGroup", underTest is ReactViewGroup ) } }