Commit 5b600ecc authored by Manuel Schrick's avatar Manuel Schrick
Browse files

Updated ViewModelTests to new ViewModels

parent 5586383f
......@@ -13,12 +13,12 @@ import java.util.List;
public class ConnectorViewModel extends ViewModel {
public List<LineViewModel> lines;
public HashSet<String> colorset;
public HashSet<String> colorSet;
@Override
public HashMap<String, Object> hashMap() {
HashMap<String, Object> map = new HashMap<>();
map.put("colors", colorset.toArray());
map.put("colors", colorSet.toArray());
return map;
}
}
......@@ -22,7 +22,7 @@ public class ConnectorGenerator extends InputGenerator implements DrawingConstan
// Array of colors which are used for drawing the lines
HashSet<String> colorSet = new HashSet<>();
connectorViewModel.colorset = colorSet;
connectorViewModel.colorSet = colorSet;
connectorViewModel.lines = new ArrayList<>();
// Color for arrowheads to/from canvas
......
......@@ -22,7 +22,7 @@ public class SingletonConnectorGenerator extends InputGenerator implements Drawi
// Array of colors which are used for drawing the lines
HashSet<String> colorSet = new HashSet<>();
connectorViewModel.colorset = colorSet;
connectorViewModel.colorSet = colorSet;
connectorViewModel.lines = new ArrayList<>();
// Color for arrowheads to/from canvas
......
......@@ -6,7 +6,6 @@ import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import java.awt.*;
import java.util.HashMap;
import java.util.HashSet;
......@@ -34,6 +33,8 @@ public class ViewModelTest {
expected.put("width", 5);
expected.put("name", "Name");
expected.put("fullName", "Fullname");
expected.put("isEmpty", false);
expected.put("fileNameSuffix", "someSuffix");
ComponentViewModel viewModel = new ComponentViewModel();
viewModel.x = 1;
......@@ -43,6 +44,8 @@ public class ViewModelTest {
viewModel.width = 5;
viewModel.name = "Name";
viewModel.fullname = "Fullname";
viewModel.isEmpty = false;
viewModel.fileNameSuffix = "someSuffix";
Assert.assertEquals(expected, viewModel.hashMap());
......@@ -102,7 +105,7 @@ public class ViewModelTest {
expected.put("colors", expectedColors.toArray());
ConnectorViewModel viewModel = new ConnectorViewModel();
viewModel.colorset = expectedColors;
viewModel.colorSet = expectedColors;
Assert.assertEquals(expected.keySet(), viewModel.hashMap().keySet());
Assert.assertArrayEquals((Object[])expected.get("colors"), (Object[]) viewModel.hashMap().get
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment