/*
 * @author Ranides Atterwim {@literal <ranides@gmail.com>}
 * @copyright Ranides Atterwim
 * @license WTFPL
 * @url http://ranides.net/projects/assira
 */
package net.ranides.assira.reflection.impl;

import static net.ranides.assira.reflection.IAttribute.*;
import org.junit.Test;
import net.ranides.assira.reflection.IHints;
import static net.ranides.assira.junit.NewAssert.*;
import static net.ranides.assira.reflection.IAttributes.of;

/**
 *
 * @author Ranides Atterwim {@literal <ranides@gmail.com>}
 */
public class AHintsTest {
    
    public AHintsTest() {
    }

    @Test
    public void testEquals() {
        IHints h1 = FElements.newHints();
        IHints h2 = FElements.newHints();
        IHints h3 = FElements.newHints();
        h1.require(of(PUBLIC, FINAL));
        h2.require(of(PUBLIC, FINAL));
        h3.require(of(BRIDGE));
        h3.discard(of(PUBLIC, NATIVE));
        
        assertEquality(h1,h2,h3);
        assertEquality(h1,h2,"");
        
        assertEquals("AHints{require=[PUBLIC, FINAL], discard=[]}", h1.toString());
        assertEquals("AHints{require=[PUBLIC, FINAL], discard=[]}", h2.toString());
        assertEquals("AHints{require=[BRIDGE], discard=[PUBLIC, NATIVE]}", h3.toString());
    }
    
    @Test
    public void testRmpty() {
        IHints none = IHints.none();
        none.require(of(BRIDGE));
        none.discard(of(PUBLIC, NATIVE));
        
        assertEquals("AHints{require=[], discard=[]}", none.toString());

        IHints h3 = FElements.newHints();
        h3.require(of(BRIDGE));
        h3.discard(of(PUBLIC, NATIVE));
        none.replace(h3);
        assertEquals("AHints{require=[], discard=[]}", none.toString());
    }
    
}
