Skip to content

Package: VTTabStylePropertyImpl_Test

VTTabStylePropertyImpl_Test

nameinstructionbranchcomplexitylinemethod
VTTabStylePropertyImpl_Test()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
equalStyles_OtherNull()
M: 0 C: 8
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
equalStyles_otherDifferent()
M: 0 C: 62
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 18
100%
M: 0 C: 1
100%
equalStyles_otherEqual()
M: 0 C: 15
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 5
100%
M: 0 C: 1
100%
setEqualFields(VTTabStyleProperty, VTTabStyleProperty)
M: 0 C: 37
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 13
100%
M: 0 C: 1
100%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2018 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * Lucas Koehler - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.view.template.style.tab.model.impl;
15:
16: import static org.junit.Assert.assertFalse;
17: import static org.junit.Assert.assertTrue;
18:
19: import org.eclipse.emf.ecp.view.template.style.tab.model.TabType;
20: import org.eclipse.emf.ecp.view.template.style.tab.model.VTTabFactory;
21: import org.eclipse.emf.ecp.view.template.style.tab.model.VTTabStyleProperty;
22: import org.junit.Test;
23:
24: /**
25: * Unit tests for {@link VTTabStylePropertyImpl}.
26: *
27: * @author Lucas Koehler
28: *
29: */
30: public class VTTabStylePropertyImpl_Test {
31:
32:         @Test
33:         public void equalStyles_otherEqual() {
34:                 final VTTabStyleProperty tabStyleProperty = VTTabFactory.eINSTANCE.createTabStyleProperty();
35:                 final VTTabStyleProperty tabStyleProperty2 = VTTabFactory.eINSTANCE.createTabStyleProperty();
36:
37:                 setEqualFields(tabStyleProperty, tabStyleProperty2);
38:                 assertTrue(tabStyleProperty.equalStyles(tabStyleProperty2));
39:         }
40:
41:         @Test
42:         public void equalStyles_otherDifferent() {
43:                 final VTTabStyleProperty tabStyleProperty = VTTabFactory.eINSTANCE.createTabStyleProperty();
44:                 final VTTabStyleProperty tabStyleProperty2 = VTTabFactory.eINSTANCE.createTabStyleProperty();
45:
46:                 setEqualFields(tabStyleProperty, tabStyleProperty2);
47:                 tabStyleProperty2.setCancelImageURL("different.png"); //$NON-NLS-1$
48:                 assertFalse(tabStyleProperty.equalStyles(tabStyleProperty2));
49:
50:                 setEqualFields(tabStyleProperty, tabStyleProperty2);
51:                 tabStyleProperty2.setErrorImageURL("different.png"); //$NON-NLS-1$
52:                 assertFalse(tabStyleProperty.equalStyles(tabStyleProperty2));
53:
54:                 setEqualFields(tabStyleProperty, tabStyleProperty2);
55:                 tabStyleProperty2.setOkImageURL("different.png"); //$NON-NLS-1$
56:                 assertFalse(tabStyleProperty.equalStyles(tabStyleProperty2));
57:
58:                 setEqualFields(tabStyleProperty, tabStyleProperty2);
59:                 tabStyleProperty2.setType(TabType.TOP);
60:                 assertFalse(tabStyleProperty.equalStyles(tabStyleProperty2));
61:
62:                 setEqualFields(tabStyleProperty, tabStyleProperty2);
63:                 tabStyleProperty2.setWarningImageURL("different.png"); //$NON-NLS-1$
64:                 assertFalse(tabStyleProperty.equalStyles(tabStyleProperty2));
65:         }
66:
67:         @Test
68:         public void equalStyles_OtherNull() {
69:                 final VTTabStyleProperty tabStyleProperty = VTTabFactory.eINSTANCE.createTabStyleProperty();
70:
71:                 assertFalse(tabStyleProperty.equalStyles(null));
72:         }
73:
74:         private void setEqualFields(VTTabStyleProperty prop1, VTTabStyleProperty prop2) {
75:                 prop1.setCancelImageURL("cancel.png"); //$NON-NLS-1$
76:                 prop2.setCancelImageURL("cancel.png"); //$NON-NLS-1$
77:
78:                 prop1.setErrorImageURL("error.png"); //$NON-NLS-1$
79:                 prop2.setErrorImageURL("error.png"); //$NON-NLS-1$
80:
81:                 prop1.setInfoImageURL("error.png"); //$NON-NLS-1$
82:                 prop2.setInfoImageURL("error.png"); //$NON-NLS-1$
83:
84:                 prop1.setOkImageURL("ok.png"); //$NON-NLS-1$
85:                 prop2.setOkImageURL("ok.png"); //$NON-NLS-1$
86:
87:                 prop1.setType(TabType.BOTTOM);
88:                 prop2.setType(TabType.BOTTOM);
89:
90:                 prop1.setWarningImageURL("warning.png"); //$NON-NLS-1$
91:                 prop2.setWarningImageURL("warning.png"); //$NON-NLS-1$
92:         }
93:
94: }