/*
 * @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 java.io.IOException;
import java.util.concurrent.atomic.AtomicBoolean;

import net.ranides.assira.reflection.IClass;
import net.ranides.test.mockup.reflection.ForBeanModel;
import org.junit.Test;

import static net.ranides.assira.junit.NewAssert.*;

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

    @Test
    public void testSomeMethod() throws IOException {
        IClass<?> ic = IClass.typeinfo(ForBeanModel.class);
        AtomicBoolean connect = new AtomicBoolean();

        ic.methods().each(m -> {
            String[] names = CDParameters.getParams(m.reflective());
            if(null == names) {
                if("void net.ranides.test.mockup.reflection.ForBeanModel.connect()".equals(m.toString())) {
                    connect.set(true);
                    return;
                }
                assertEquals(IClass.OBJECT, m.parent());
            }
        });
        assertTrue(connect.get());
    }
    
}
