/*
 * The Exomiser - A tool to annotate and prioritize genomic variants
 *
 * Copyright (c) 2016-2021 Queen Mary University of London.
 * Copyright (c) 2012-2016 Charité Universitätsmedizin Berlin and Genome Research Ltd.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package org.monarchinitiative.exomiser.core.analysis.util;

import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvSource;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;

class GeneConstraintTest {

    @ParameterizedTest
    @CsvSource({
            "0.7635, false",
            "0.76349, true",
    })
    void testGeneIsLofIntolerant(double loufUpper, boolean expected) {
        GeneConstraint instance = new GeneConstraint("GENE1", "ENST000000000", 0, 0, 0, loufUpper);
        assertThat(instance.loeufUpper(), equalTo(loufUpper));
        assertThat(instance.isLossOfFunctionIntolerant(), equalTo(expected));
    }
}
/*
 * The Exomiser - A tool to annotate and prioritize genomic variants
 *
 * Copyright (c) 2016-2021 Queen Mary University of London.
 * Copyright (c) 2012-2016 Charité Universitätsmedizin Berlin and Genome Research Ltd.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package org.monarchinitiative.exomiser.core.analysis.util;

import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvSource;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;

class GeneConstraintTest {

    @ParameterizedTest
    @CsvSource({
            "0.7635, false",
            "0.76349, true",
    })
    void testGeneIsLofIntolerant(double louf, boolean expected) {
        GeneConstraint instance = new GeneConstraint("GENE1", "ENST000000000", 0, louf, 0, 0);
        assertThat(instance.loeuf(), equalTo(louf));
        assertThat(instance.isLossOfFunctionIntolerant(), equalTo(expected));
    }
}
Update GeneConstraintTest to use relaxed constraints