Package: VTTextControlEnablementStylePropertyImpl_Test
VTTextControlEnablementStylePropertyImpl_Test
name | instruction | branch | complexity | line | method | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
VTTextControlEnablementStylePropertyImpl_Test() |
|
|
|
|
|
||||||||||||||||||||
equalStyles_OtherNull() |
|
|
|
|
|
||||||||||||||||||||
equalStyles_otherDifferent() |
|
|
|
|
|
||||||||||||||||||||
equalStyles_otherEqual() |
|
|
|
|
|
||||||||||||||||||||
setEqualFields(VTTextControlEnablementStyleProperty, VTTextControlEnablementStyleProperty) |
|
|
|
|
|
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.textControlEnablement.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.tableValidation.model.VTTableValidationFactory;
20: import org.eclipse.emf.ecp.view.template.style.tableValidation.model.VTTableValidationStyleProperty;
21: import org.eclipse.emf.ecp.view.template.style.textControlEnablement.model.VTTextControlEnablementFactory;
22: import org.eclipse.emf.ecp.view.template.style.textControlEnablement.model.VTTextControlEnablementStyleProperty;
23: import org.junit.Test;
24:
25: /**
26: * Unit tests for {@link VTTextControlEnablementStylePropertyImpl}.
27: *
28: * @author Lucas Koehler
29: *
30: */
31: public class VTTextControlEnablementStylePropertyImpl_Test {
32:
33:         @Test
34:         public void equalStyles_otherEqual() {
35:                 final VTTextControlEnablementStyleProperty property = VTTextControlEnablementFactory.eINSTANCE
36:                         .createTextControlEnablementStyleProperty();
37:                 final VTTextControlEnablementStyleProperty property2 = VTTextControlEnablementFactory.eINSTANCE
38:                         .createTextControlEnablementStyleProperty();
39:
40:                 setEqualFields(property, property2);
41:                 assertTrue(property.equalStyles(property2));
42:         }
43:
44:         @Test
45:         public void equalStyles_otherDifferent() {
46:                 final VTTextControlEnablementStyleProperty property = VTTextControlEnablementFactory.eINSTANCE
47:                         .createTextControlEnablementStyleProperty();
48:                 final VTTextControlEnablementStyleProperty property2 = VTTextControlEnablementFactory.eINSTANCE
49:                         .createTextControlEnablementStyleProperty();
50:
51:                 setEqualFields(property, property2);
52:                 property2.setRenderDisableAsEditable(false);
53:                 assertFalse(property.equalStyles(property2));
54:         }
55:
56:         @Test
57:         public void equalStyles_OtherNull() {
58:                 final VTTableValidationStyleProperty tableValidationStyleProperty = VTTableValidationFactory.eINSTANCE
59:                         .createTableValidationStyleProperty();
60:
61:                 assertFalse(tableValidationStyleProperty.equalStyles(null));
62:         }
63:
64:         private void setEqualFields(VTTextControlEnablementStyleProperty prop1,
65:                 VTTextControlEnablementStyleProperty prop2) {
66:
67:                 prop1.setRenderDisableAsEditable(true);
68:                 prop2.setRenderDisableAsEditable(true);
69:         }
70:
71: }