package unit.com.bitdubai.fermat_dmp_plugin.layer.actor.extra_user.developer.bitdubai.version_1.ExtraUserUserAddonRoot;

import com.bitdubai.fermat_dmp_plugin.layer.actor.extra_user.developer.bitdubai.version_1.ExtraUserUserAddonRoot;

import org.fest.assertions.api.Assertions;
import org.junit.Test;

/**
 * Created by Manuel Perez on 28/07/15.
 */
public class SetErrorManagerTest {

    @Test
    public void setErrorManagerTest_setValidErrorManager_theErrorManagerIsSet()throws Exception{

        ExtraUserUserAddonRoot extraUserUserAddonRoot=new ExtraUserUserAddonRoot();
        MockErrorManager mockErrorManager=new MockErrorManager();
        extraUserUserAddonRoot.setErrorManager(mockErrorManager);

    }

    @Test
    public void setErrorManagerTest_setValidErrorManagerAnExceptionIsThrown_theErrorManagerContainsTheExceptionInformation() throws Exception{

        ExtraUserUserAddonRoot anotherExtraUserUserAddonRoot=new ExtraUserUserAddonRoot();
        MockErrorManager mockErrorManager=new MockErrorManager();
        anotherExtraUserUserAddonRoot.setErrorManager(mockErrorManager);
        anotherExtraUserUserAddonRoot.createActor(null);
        Assertions.assertThat(mockErrorManager).isNotNull();

    }

    @Test(expected = Exception.class)
    public void setErrorManagerTest_setNullErrorManagerAnExceptionIsThrown_throwsAnException() throws Exception{

        ExtraUserUserAddonRoot anotherExtraUserUserAddonRoot=new ExtraUserUserAddonRoot();
        MockErrorManager mockErrorManager=null;
        anotherExtraUserUserAddonRoot.setErrorManager(mockErrorManager);
        anotherExtraUserUserAddonRoot.createActor(null);
        Assertions.assertThat(mockErrorManager).isNotNull();

    }

}

@@ -381,32 +381,60 @@
 est %7B%0A%0A    @Test
+(expected = Exception.class)
 %0A    public void
@@ -449,37 +449,36 @@
 rManagerTest_set
-Valid
+Null
 ErrorManager_the
@@ -477,31 +477,48 @@
 ager
-_theErrorManagerIsSet
+AnExceptionIsThrown_throwsAnException
 ()
+ 
 thro
@@ -563,17 +563,24 @@
 donRoot 
-e
+anotherE
 xtraUser
@@ -658,36 +658,92 @@
 ckErrorManager=n
-ew M
+ull;%0A        anotherExtraUserUserAddonRoot.setErrorManager(m
 ockErrorManager(
@@ -733,33 +733,32 @@
 mockErrorManager
-(
 );%0A        extra
@@ -752,17 +752,24 @@
         
-e
+anotherE
 xtraUser
@@ -778,39 +778,72 @@
 erAddonRoot.
-setErrorManager
+createActor(null);%0A        Assertions.assertThat
 (mockErrorMa
@@ -848,16 +848,28 @@
 Manager)
+.isNotNull()
 ;%0A%0A    %7D
@@ -1393,36 +1393,8 @@
 Test
-(expected = Exception.class)
 %0A   
@@ -1421,36 +1421,37 @@
 rManagerTest_set
-Null
+Valid
 ErrorManagerAnEx
@@ -1450,48 +1450,31 @@
 ager
-AnExceptionIsThrown_throwsAnException
+_theErrorManagerIsSet
 ()
- 
 thro
@@ -1515,32 +1515,25 @@
 erAddonRoot 
-anotherE
+e
 xtraUserUser
@@ -1619,68 +1619,12 @@
 er=n
-ull;%0A        anotherExtraUserUserAddonRoot.setErrorManager(m
+ew M
 ockE
@@ -1626,32 +1626,33 @@
 MockErrorManager
+(
 );%0A        anoth
@@ -1642,32 +1642,25 @@
 ();%0A        
-anotherE
+e
 xtraUserUser
@@ -1673,56 +1673,23 @@
 oot.
-createActor(null);%0A        Assertions.assertThat
+setErrorManager
 (moc
@@ -1698,36 +1698,24 @@
 rrorManager)
-.isNotNull()
 ;%0A%0A    %7D%0A%0A%7D%0A
@@ -1712,10 +1712,13 @@
 %0A    %7D%0A%0A
+%0A%0A%0A
 %7D%0A

Fix the tests.