package cl.fatman.capital.fund;

import static org.junit.Assert.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import java.util.List;

public class ControllerFailTest {
	
	private Controller control;
	private PersistenceData persistence;
	
	@Before
	public void setUp() {
		control = Controller.getInstance();
		control.setUp();
		persistence = PersistenceData.getInstance();
	}
	
	@After
	public void tearDown() {
		control.tearDown();
	}
	
	@Test
	public void storeFundDataFailTest() {
		control.storeFundData();
		control.storeFundData();
		List<?> fundRateList = persistence.selectAllObjects("from FundRate", FundRate.class);
		assertEquals("Fund rate list size shold be 0.", 0, fundRateList.size());
	}
}
@@ -133,16 +133,44 @@
 .Test;%0A%0A
+import java.time.LocalDate;%0A
 import j
@@ -758,9 +758,372 @@
 ());%0A%09%7D%0A
+%09%0A%09@Test%0A%09public void storeFomentUnitDataFailTest() %7B%0A%09%09LocalDate startDate = LocalDate.of(1910, 1, 1);%0A%09%09LocalDate endDate = LocalDate.of(1912, 1, 1);%0A%09%09control.storeFomentUnitData(startDate, endDate);%0A%09%09List%3C?%3E ufList = persistence.selectAllObjects(%22from FomentUnit%22, FomentUnit.class);%0A%09%09assertEquals(%22Foment unit list size shold be 0.%22, 0, ufList.size());%0A%09%7D%0A
 %7D

Add junit test for foment unit retrieve fail.