テストでandroid.view.InflateException: Binary XML file line #9となっていた時の対処メモ

# やりたかったこと
Navigatorのテストを書きたくてやってみましたが、動かなかったのでメモ
## 動かなかったコード
```Kotlin
@RunWith(AndroidJUnit4::class)
class NavigatorTest {
    @Test
    fun testNavigation(){
        val navController = TestNavHostController(ApplicationProvider.getApplicationContext())

        val topScenario = launchFragmentInContainer<TopFragment>()

        topScenario.onFragment{fragment ->
            navController.setGraph(R.navigation.nav_graph)
            Navigation.setViewNavController(fragment.requireView(),navController)
        }

        onView(ViewMatchers.withId(R.id.setting_button)).perform(click())
        assertEquals(navController.currentDestination?.id,R.id.settingFragment)
    }
}
```

## 出力されたエラー
```
android.view.InflateException: Binary XML file line #9 in xyz.miyayu.android.weatherapp:layout/top_fragment: Binary XML file line #9 in xyz.miyayu.android.weatherapp:layout/top_fragment: Error inflating class androidx.cardview.widget.CardView
Caused by: android.view.InflateException: Binary XML file line #9 in xyz.miyayu.android.weatherapp:layout/top_fragment: Error inflating class androidx.cardview.widget.CardView
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
at android.view.LayoutInflater.createView(LayoutInflater.java:852)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1004)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:959)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1121)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1082)
at android.view.LayoutInflater.inflate(LayoutInflater.java:680)
at android.view.LayoutInflater.inflate(LayoutInflater.java:532)
at xyz.miyayu.android.weatherapp.databinding.TopFragmentBinding.inflate(TopFragmentBinding.java:44)
at xyz.miyayu.android.weatherapp.TopFragment.onCreateView(TopFragment.kt:21)
at androidx.fragment.app.Fragment.performCreateView(Fragment.java:3104)
at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:524)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:261)
at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1890)
at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1808)
at androidx.fragment.app.FragmentManager.execSingleAction(FragmentManager.java:1720)
at androidx.fragment.app.BackStackRecord.commitNow(BackStackRecord.java:317)
at androidx.fragment.app.testing.FragmentScenario$Companion.internalLaunch$lambda-2(FragmentScenario.kt:621)
at androidx.fragment.app.testing.FragmentScenario$Companion.$r8$lambda$qQn68eFQCuWOFZCsJdZ7z8QDNvM(Unknown Source:0)
at androidx.fragment.app.testing.FragmentScenario$Companion$$ExternalSyntheticLambda0.perform(Unknown Source:13)
at androidx.test.core.app.ActivityScenario.lambda$onActivity$2$ActivityScenario(ActivityScenario.java:660)
at androidx.test.core.app.ActivityScenario$$Lambda$4.run(ActivityScenario.java:652)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at android.app.Instrumentation$SyncRunnable.run(Instrumentation.java:2223)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Caused by: java.lang.UnsupportedOperationException: Failed to resolve attribute at index 2: TypedValue{t=0x2/d=0x7f0300fe a=-1}
at android.content.res.TypedArray.getColorStateList(TypedArray.java:597)
at androidx.cardview.widget.CardView.<init>(CardView.java:127)
at androidx.cardview.widget.CardView.<init>(CardView.java:117)
```

## 原因
スタイルの設定がされていなかったため。

## 修正
```Kotlin
val topScenario = launchFragmentInContainer<TopFragment>(null,R.style./**自身のテーマ**/)
```