package com.foxx.androidcast.discovery;

/*********************************************************************
 * DiscoverySelfFilterTest.java
 * Created at: Sun 17 May 2026 15:45:19 +0200
 * Updated at: Wed 20 May 2026 15:17:13 +0200 by Anton Afanasyeu <a.afanasieff@gmail.com>
 * Commit: 5d8e82d2e60a21fff3138d2a394ee4e8b4c6dcb8
 * class DiscoverySelfFilterTest
 * Contributors:
 *    - Anton Afanasyeu <a.afanasieff@gmail.com> (2 commits, 28 lines)
 *    - Cursor Agent (project assistant)
 * Digest: SHA256	04f54b58680a2d194d167bf2fecb3cf498a7ec9095290606fb2657a95b4efe29
**********************************************************************/
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import org.junit.Test;

public class DiscoverySelfFilterTest {

    @Test
    public void isLocalHost_detectsLoopback() {
        assertTrue(DiscoverySelfFilter.isLocalHost("127.0.0.1"));
        assertFalse(DiscoverySelfFilter.isLocalHost("192.168.33.106"));
    }

    @Test
    public void isSelf_withoutContext_usesHostOnly() {
        assertTrue(DiscoverySelfFilter.isSelf(null, "127.0.0.1", ""));
        assertFalse(DiscoverySelfFilter.isSelf(null, "10.0.0.5", "other-uuid"));
    }
}
