package com.rosetta.messenger.data

import org.junit.Test
import org.junit.Assert.*

/**
 * Unit tests for DecryptedAccount data class
 */
class DecryptedAccountTest {
    
    @Test
    fun `DecryptedAccount should be created with all fields`() {
        val account = DecryptedAccount(
            publicKey = "04abcdef",
            privateKey = "privatekey123",
            seedPhrase = listOf("word1", "word2"),
            privateKeyHash = "hash123",
            name = "Test User"
        )
        
        assertEquals("04abcdef", account.publicKey)
        assertEquals("privatekey123", account.privateKey)
        assertEquals(listOf("word1", "word2"), account.seedPhrase)
        assertEquals("hash123", account.privateKeyHash)
        assertEquals("Test User", account.name)
    }
    
    @Test
    fun `DecryptedAccount should have default name`() {
        val account = DecryptedAccount(
            publicKey = "04abcdef",
            privateKey = "privatekey123",
            seedPhrase = listOf("word1", "word2"),
            privateKeyHash = "hash123"
        )
        
        assertEquals("Default name should be Account", "Account", account.name)
    }
    
    @Test
    fun `DecryptedAccount equality should work correctly`() {
        val account1 = DecryptedAccount(
            publicKey = "04abcdef",
            privateKey = "privatekey123",
            seedPhrase = listOf("word1", "word2"),
            privateKeyHash = "hash123",
            name = "User"
        )
        
        val account2 = DecryptedAccount(
            publicKey = "04abcdef",
            privateKey = "privatekey123",
            seedPhrase = listOf("word1", "word2"),
            privateKeyHash = "hash123",
            name = "User"
        )
        
        assertEquals("Identical accounts should be equal", account1, account2)
    }
    
    @Test
    fun `DecryptedAccount with different publicKey should not be equal`() {
        val account1 = DecryptedAccount(
            publicKey = "04abcdef1",
            privateKey = "privatekey123",
            seedPhrase = listOf("word1", "word2"),
            privateKeyHash = "hash123",
            name = "User"
        )
        
        val account2 = DecryptedAccount(
            publicKey = "04abcdef2",
            privateKey = "privatekey123",
            seedPhrase = listOf("word1", "word2"),
            privateKeyHash = "hash123",
            name = "User"
        )
        
        assertNotEquals("Accounts with different publicKey should not be equal", account1, account2)
    }
}
