package com.syntactic;

import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;

/**
 * Unit test for simple App.
 */
public class AppTest 
    extends TestCase
{
    /**
     * Create the test case
     *
     * @param testName name of the test case
     */
    public AppTest( String testName )
    {
        super( testName );
    }

    /**
     * @return the suite of tests being tested
     */
    public static Test suite()
    {
        return new TestSuite( AppTest.class );
    }

    /**
     * Rigourous Test :-)
     */
    public void testApp()
    {
        assertTrue( true );
    }
}

@@ -17,38 +17,173 @@
 actic;%0A%0A
+%0A
 import 
-junit.framework
+com.syntactic.controllers.HomeController;%0Aimport com.syntactic.models.LibraryItem;%0Aimport com.syntactic.services.LibraryItemService;%0Aimport org.junit
 .Test;%0Ai
@@ -192,416 +192,1070 @@
 ort 
+org.
 junit.
-framework.TestCase;%0Aimport junit.framework.TestSuite;%0A%0A/**%0A * Unit test for simple App.%0A */%0Apublic class AppTest %0A    extends TestCase%0A%7B%0A    /**%0A     * Create the test case%0A     *%0A     * @param testName name of the test case%0A     */%0A    public AppTest( String testName )%0A    %7B%0A        super( testName 
+runner.RunWith;%0Aimport org.mockito.InjectMocks;%0Aimport org.mockito.Mock;%0Aimport org.mockito.Mockito;%0Aimport org.mockito.runners.MockitoJUnitRunner;%0Aimport org.springframework.boot.test.SpringApplicationConfiguration;%0A%0Aimport java.util.Arrays;%0Aimport java.util.List;%0A%0Aimport static junit.framework.TestCase.assertTrue;%0Aimport static org.mockito.Mockito.verify;%0Aimport static org.mockito.Mockito.when;%0A%0A@RunWith(MockitoJUnitRunner.class)%0A@SpringApplicationConfiguration(App.class)%0Apublic class AppTest%0A%7B%0A    @Mock%0A    private LibraryItemService libraryItemService;%0A%0A%0A    @InjectMocks%0A    private HomeController homeController;%0A%0A    @Test%0A    public void HomeController_Index_Should_Return_All_Data()%0A    %7B%0A        LibraryItem libraryItem = Mockito.mock(LibraryItem.class
 );%0A    
-%7D%0A%0A
     
-/**%0A     * @return the suite of tests being tested%0A     */%0A    public static Test sui
+List%3CLibraryItem%3E allLibraryItems = Arrays.asList(libraryItem);%0A%0A        when(libraryItemService.GetAll()).thenReturn(allLibraryItems);%0A%0A        assertTrue( homeController.Index().equals(allLibraryItems));%0A    %7D%0A%0A    @Test%0A    public void HomeController_Add_Should_Add_I
 te
+m
 ()%0A 
@@ -1271,153 +1271,319 @@
     
-return new TestSuite( AppTest
+LibraryItem libraryItem = Mockito.mock(LibraryItem
 .class
- 
 );%0A
+%0A%0A
     
-%7D%0A%0A
     
-/**%0A     * Rigourous Test :-)%0A     */%0A    public void testApp()%0A    %7B%0A        assertTrue( true 
+Mockito.when(libraryItemService.Add(libraryItem)).thenReturn(libraryItem);%0A%0A        homeController.Add(libraryItem);%0A%0A        verify(libraryItemService).Add(libraryItem);%0A%0A        assertTrue(homeController.Add(libraryItem).equals(libraryItem)
 );%0A 

add the initial test for home controller