package ksiazka.kucharska;
|
|
|
|
import static org.junit.Assert.*;
|
|
|
|
import javax.swing.DefaultListModel;
|
|
import javax.swing.JList;
|
|
|
|
import ksiazka.kucharska.CB_View;
|
|
|
|
import org.junit.Test;
|
|
|
|
public class AddRecipeTest {
|
|
|
|
@Test
|
|
public void testAdd() {
|
|
CB_View theView = new CB_View();
|
|
JList recipesList = theView.getRecipesList();
|
|
DefaultListModel model = (DefaultListModel) recipesList.getModel();
|
|
model.addElement("recipe1");
|
|
int last = model.getSize()-1;
|
|
String item = recipesList.getModel().getElementAt(last).toString();
|
|
assertEquals("recipe1", item);
|
|
}
|
|
|
|
}
|