package uk.ac.ebi.quickgo.geneproduct.common.common;

import uk.ac.ebi.quickgo.geneproduct.common.ProteomeMembership;

import org.junit.Test;

import static org.hamcrest.Matchers.is;
import static org.springframework.test.util.MatcherAssertionErrors.assertThat;
import static uk.ac.ebi.quickgo.geneproduct.common.ProteomeMembership.COMPLETE;
import static uk.ac.ebi.quickgo.geneproduct.common.ProteomeMembership.NONE;
import static uk.ac.ebi.quickgo.geneproduct.common.ProteomeMembership.NOT_APPLICABLE;
import static uk.ac.ebi.quickgo.geneproduct.common.ProteomeMembership.REFERENCE;

/**
 * @author Tony Wardell
 * Date: 15/03/2018
 * Time: 13:16
 * Created with IntelliJ IDEA.
 */
public class ProteomeMembershipTest {

    @Test
    public void checkMembershipCreationRules() {
        assertThat(ProteomeMembership.membership(false, true, true), is(NOT_APPLICABLE.toString()));
        assertThat(ProteomeMembership.membership(false, false, true), is(NOT_APPLICABLE.toString()));
        assertThat(ProteomeMembership.membership(false, true, false), is(NOT_APPLICABLE.toString()));
        assertThat(ProteomeMembership.membership(true, true, true), is(REFERENCE.toString()));
        assertThat(ProteomeMembership.membership(true, true, false), is(REFERENCE.toString()));
        assertThat(ProteomeMembership.membership(true, false, true), is(COMPLETE.toString()));
        assertThat(ProteomeMembership.membership(true, false, false), is(NONE.toString()));
    }

}

@@ -746,14 +746,9 @@
 oid 
-checkM
+m
 embe
@@ -764,12 +764,19 @@
 tion
-Rule
+Permutation
 s() 
@@ -1360,32 +1360,32 @@
 E.toString()));%0A
-
         assertTh
@@ -1456,21 +1456,796 @@
 String()));%0A
+        assertThat(ProteomeMembership.membership(true, true, true), is(REFERENCE.toString()));%0A    %7D%0A%0A    @Test%0A    public void fromString() %7B%0A        assertThat(ProteomeMembership.fromString(%22Not applicable%22), is(NOT_APPLICABLE));%0A        assertThat(ProteomeMembership.fromString(%22Not aPPlicable%22), is(NOT_APPLICABLE));%0A%0A        assertThat(ProteomeMembership.fromString(%22Reference%22), is(REFERENCE));%0A        assertThat(ProteomeMembership.fromString(%22referEnce%22), is(REFERENCE));%0A%0A        assertThat(ProteomeMembership.fromString(%22Complete%22), is(COMPLETE));%0A        assertThat(ProteomeMembership.fromString(%22CompLete%22), is(COMPLETE));%0A%0A        assertThat(ProteomeMembership.fromString(%22None%22), is(NONE));%0A        assertThat(ProteomeMembership.fromString(%22NoNe%22), is(NONE));%0A%0A
     %7D%0A%0A%7D%0A

Add test for fromString()