@Before public void setUp() { Casing front = new Casing(); front.addDefect(new Defect(Type.MINOR)); front.addDefect(new Defect(Type.MAJOR)); front.addDefect(new Defect(Type.MASSIVE)); Casing rear = new Casing(); Hinge hinge = new Hinge(); hinge.addDefect(new Defect(Type.MINOR)); hinge.addDefect(new Defect(Type.MASSIVE)); Widget widget = new Widget(); widget.addDefect(new Defect(Type.MINOR)); List<Widget> widgets = new ArrayList<Widget>(); widgets.add(widget); widget = new Widget(); widget.addDefect(new Defect(Type.MINOR)); widgets.add(widget); widget = new Widget(); widget.addDefect(new Defect(Type.MAJOR)); widgets.add(widget); widgets.add(new Widget()); widgets.add(new Widget()); sut = new Frill(widgets, front, rear, hinge); }
@Test public void testTierIncompleteRearCasing() { Casing c = sut.getRearCasing(); c.addDefect(new Defect(Type.INCOMPLETE)); assertThat(sut.calculateTier(), is(equalTo(Tier.INCOMPLETE))); }
public Object getValue() { return (Double) (casing.getHeight() * casing.getWidth()); }