package com.tt.honeyDue.viewmodel

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

class AuthViewModelTest {

    // MARK: - Initialization Tests

    @Test
    fun testInitialLoginState() {
        // Given
        val viewModel = AuthViewModel()

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

    @Test
    fun testInitialRegisterState() {
        // Given
        val viewModel = AuthViewModel()

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

    @Test
    fun testInitialVerifyEmailState() {
        // Given
        val viewModel = AuthViewModel()

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

    @Test
    fun testInitialUpdateProfileState() {
        // Given
        val viewModel = AuthViewModel()

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

    @Test
    fun testResetRegisterState() {
        // Given
        val viewModel = AuthViewModel()

        // When
        viewModel.resetRegisterState()

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

    // MARK: - Delete Account Tests

    @Test
    fun testInitialDeleteAccountState() {
        // Given
        val viewModel = AuthViewModel()

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

    @Test
    fun testResetDeleteAccountState() {
        // Given
        val viewModel = AuthViewModel()

        // When
        viewModel.resetDeleteAccountState()

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