package com.tt.honeyDue.viewmodel

import com.tt.honeyDue.viewmodel.ContractorViewModel
import com.tt.honeyDue.network.ApiResult
import kotlin.test.Test
import kotlin.test.assertIs

class ContractorViewModelTest {

    // MARK: - Initialization Tests

    @Test
    fun testInitialContractorsState() {
        // Given
        val viewModel = ContractorViewModel()

        // Then
        assertIs<ApiResult.Idle>(viewModel.contractorsState.value)
    }

    @Test
    fun testInitialContractorDetailState() {
        // Given
        val viewModel = ContractorViewModel()

        // Then
        assertIs<ApiResult.Idle>(viewModel.contractorDetailState.value)
    }

    @Test
    fun testInitialCreateState() {
        // Given
        val viewModel = ContractorViewModel()

        // Then
        assertIs<ApiResult.Idle>(viewModel.createState.value)
    }

    @Test
    fun testInitialUpdateState() {
        // Given
        val viewModel = ContractorViewModel()

        // Then
        assertIs<ApiResult.Idle>(viewModel.updateState.value)
    }

    @Test
    fun testInitialDeleteState() {
        // Given
        val viewModel = ContractorViewModel()

        // Then
        assertIs<ApiResult.Idle>(viewModel.deleteState.value)
    }

    @Test
    fun testInitialToggleFavoriteState() {
        // Given
        val viewModel = ContractorViewModel()

        // Then
        assertIs<ApiResult.Idle>(viewModel.toggleFavoriteState.value)
    }
}
