@Test public void testSetGetCost() { assertEquals(equipment.getCost(), COST, 0.0); Double newCost = 1900.0; equipment.setCost(newCost); assertEquals(equipment.getCost(), newCost, 80000.0); }
@Test public void testSetGetBattery() { assertEquals(battery, equipment.getBattery()); Battery bat = new Battery(); equipment.setBattery(bat); assertEquals(bat, equipment.getBattery()); }
@Test public void testSetGetPanels() { assertEquals(equipment.getPanels(), panels); ArrayList<Panel> newPanels = new ArrayList<Panel>(); equipment.setPanels(newPanels); assertEquals(equipment.getPanels(), newPanels); }
@Test public void testSetGetInverter() { assertEquals(equipment.getInverter(), inverter); Inverter newInverter = new Inverter(); equipment.setInverter(newInverter); assertEquals(equipment.getInverter(), newInverter); }
@Test public void testSetGetInverters() { assertEquals(equipment.getInverters(), inverters); ArrayList<Inverter> newInverters = new ArrayList<Inverter>(); equipment.setInverters(newInverters); assertEquals(equipment.getPanels(), newInverters); }
@Test public void testSizeOf0() { assertEquals(equipment.getSize(), SIZE, 0.0); Double newSize = 0.0; equipment.setSize(newSize); assertEquals(equipment.getSize(), newSize, 0.0); }
@Before public void setUp() throws Exception { equipment = new Equipment(); equipment.setCost(COST); equipment.setSize(SIZE); inverter = new Inverter(); equipment.setInverter(inverter); panels = new ArrayList<Panel>(); equipment.setPanels(panels); battery = new Battery(); equipment.setBattery(battery); inverters = new ArrayList<Inverter>(); }
@Test public void testSetGetTotalPanels() { int newSelectedNoOfPanel = 0; assertEquals(equipment.getTotalPanels(), newSelectedNoOfPanel); }
@Test public void testSetGetKitName() { equipment.setKitName("4KWh - 8 500W"); assertEquals("4KWh - 8 500W", equipment.getKitName()); }
@Test public void testHighSize() { Double newSize = 999.999; equipment.setSize(newSize); assertEquals(equipment.getSize(), newSize, 0.0); }
@Test public void testCostOf0() { Double newCost = 0.0; equipment.setCost(newCost); assertEquals(equipment.getCost(), newCost, 80000.0); }
@Test public void testHighCost() { Double newCost = 9999.9999; equipment.setCost(newCost); assertEquals(equipment.getCost(), newCost, 80000.0); }