package com.mood.jenaPlus;

import org.junit.Test;

import static junit.framework.Assert.assertTrue;
import static junit.framework.TestCase.assertFalse;

/**
 * Created by carrotji on 2017-02-26.
 */

public class FollowListTest {

    @Test
    public void testFollowingRejected(){
        String UserName1 = "Jena1";
        String UserName2 = "Jena2";
        Participant newParticipant1 = new Participant(UserName1);
        Participant newParticipant2 = new Participant(UserName2);

        newParticipant1.followingParticipantsRequest(newParticipant2);
        assertFalse(newParticipant1.getPendingFollowing().isEmpty());
        assertTrue(newParticipant1.getFollowing().isEmpty());

        newParticipant2.followingParticipantsRejected(newParticipant1);
        assertTrue(newParticipant2.getPendingFollowers().isEmpty());
        assertTrue(newParticipant2.getFollowers().isEmpty());
        assertTrue(newParticipant1.getFollowing().isEmpty());
    }


    @Test
    public void testFollowingAccepted(){
        String UserName1 = "Jena1";
        String UserName2 = "Jena2";
        Participant par1 = new Participant(UserName1);
        Participant par2 = new Participant(UserName2);

        par1.followingParticipantsRequest(par2);
        assertFalse(par1.getPendingFollowing().isEmpty());
        assertTrue(par1.getFollowing().isEmpty());
        assertTrue(par2.getFollowers().isEmpty());

        par2.followingParticipantsAccepted(par1);
        assertTrue(par2.getPendingFollowers().isEmpty());
        assertFalse(par2.getFollowing().isEmpty());

    }

    @Test
    public void testFollowingRequest(){
        String UserName1 = "Jena1";
        String UserName2 = "Jena2";
        Participant par1 = new Participant(UserName1);
        Participant par2 = new Participant(UserName2);

        par1.followingParticipantsRequest(par2);
        par1.followingParticipantsRequest(par2);
        assertFalse(par1.getPendingFollowing().isEmpty());
        assertTrue(par1.getFollowing().isEmpty());
        assertTrue(par2.getFollowers().isEmpty());

    }

    @Test
    public void testFollowersRequest(){
        String UserName1 = "Jena1";
        String UserName2 = "Jena2";
        Participant par1 = new Participant(UserName1);
        Participant par2 = new Participant(UserName2);

        par1.followerParticipantsRequest(par2);
        //assertFalse(par1.getPendingFollowers().isEmpty());
        //assertTrue(par1.getFollowers().isEmpty());
        //assertTrue(par2.getFollowing().isEmpty());

    }

    @Test
    public void testFollowersAccepted(){
        String UserName1 = "Jena1";
        String UserName2 = "Jena2";
        Participant par1 = new Participant(UserName1);
        Participant par2 = new Participant(UserName2);

    }

    @Test
    public void testFollowersRejected(){
        String UserName1 = "Jena1";
        String UserName2 = "Jena2";
        Participant par1 = new Participant(UserName1);
        Participant par2 = new Participant(UserName2);


    }
}

@@ -1857,57 +1857,8 @@
 2);%0A
-        par1.followingParticipantsRequest(par2);%0A
     
@@ -2247,32 +2247,68 @@
 nt(UserName2);%0A%0A
+        //par2 wants to follow par1%0A
         par1.fol
@@ -2343,26 +2343,24 @@
 2);%0A        
-//
 assertFalse(
@@ -2398,34 +2398,32 @@
 pty());%0A        
-//
 assertTrue(par1.
@@ -2457,18 +2457,16 @@
         
-//
 assertTr
@@ -2750,245 +2750,1042 @@
     
-%7D%0A%0A    @Test%0A    public void testFollowersRejected()%7B%0A        String UserName1 = %22Jena1%22;%0A        String UserName2 = %22Jena2%22;%0A        Participant par1 = new Participant(UserName1);%0A        Participant par2 = new Participant(UserName2);%0A%0A
+    par1.followerParticipantsRequest(par2);%0A        assertFalse(par1.getPendingFollowers().isEmpty());%0A        assertTrue(par1.getFollowers().isEmpty());%0A        assertTrue(par2.getFollowing().isEmpty());%0A%0A        par1.followerParticipantsAccepted(par2);%0A        assertTrue(par1.getPendingFollowers().isEmpty());%0A        assertFalse(par1.getFollowers().isEmpty());%0A%0A    %7D%0A%0A    @Test%0A    public void testFollowersRejected()%7B%0A        String UserName1 = %22Jena1%22;%0A        String UserName2 = %22Jena2%22;%0A        Participant par1 = new Participant(UserName1);%0A        Participant par2 = new Participant(UserName2);%0A%0A        par1.followerParticipantsRequest(par2);%0A        assertFalse(par1.getPendingFollowers().isEmpty());%0A        assertTrue(par1.getFollowers().isEmpty());%0A        assertTrue(par2.getFollowing().isEmpty());%0A%0A        par1.followerParticipantsRejected(par2);%0A        assertTrue(par1.getFollowers().isEmpty());%0A        assertTrue(par2.getFollowing().isEmpty());%0A        assertTrue(par1.getPendingFollowers().isEmpty());%0A        
 %0A   

update followingTest