Skip to content

Package: VTBackgroundStylePropertyImpl_Test

VTBackgroundStylePropertyImpl_Test

nameinstructionbranchcomplexitylinemethod
VTBackgroundStylePropertyImpl_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: 4
100%
M: 0 C: 1
100%
equalStyles_ignoreColorStringCase()
M: 0 C: 18
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 8
100%
M: 0 C: 1
100%
equalStyles_otherDifferent()
M: 0 C: 18
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 8
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: 7
100%
M: 0 C: 1
100%
setEqualFields(VTBackgroundStyleProperty, VTBackgroundStyleProperty)
M: 0 C: 7
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
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.background.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.background.model.VTBackgroundFactory;
20: import org.eclipse.emf.ecp.view.template.style.background.model.VTBackgroundStyleProperty;
21: import org.junit.Test;
22:
23: /**
24: * Unit tests for {@link VTBackgroundStylePropertyImpl}.
25: *
26: * @author Lucas Koehler
27: *
28: */
29: public class VTBackgroundStylePropertyImpl_Test {
30:
31:         @Test
32:         public void equalStyles_otherEqual() {
33:                 final VTBackgroundStyleProperty backgroundStyleProperty = VTBackgroundFactory.eINSTANCE
34:                         .createBackgroundStyleProperty();
35:                 final VTBackgroundStyleProperty backgroundStyleProperty2 = VTBackgroundFactory.eINSTANCE
36:                         .createBackgroundStyleProperty();
37:
38:                 setEqualFields(backgroundStyleProperty, backgroundStyleProperty2);
39:                 assertTrue(backgroundStyleProperty.equalStyles(backgroundStyleProperty2));
40:         }
41:
42:         @Test
43:         public void equalStyles_ignoreColorStringCase() {
44:                 final VTBackgroundStyleProperty backgroundStyleProperty = VTBackgroundFactory.eINSTANCE
45:                         .createBackgroundStyleProperty();
46:                 final VTBackgroundStyleProperty backgroundStyleProperty2 = VTBackgroundFactory.eINSTANCE
47:                         .createBackgroundStyleProperty();
48:
49:                 setEqualFields(backgroundStyleProperty, backgroundStyleProperty2);
50:                 backgroundStyleProperty2.setColor("#AAAAAA"); //$NON-NLS-1$
51:                 assertTrue(backgroundStyleProperty.equalStyles(backgroundStyleProperty2));
52:         }
53:
54:         @Test
55:         public void equalStyles_otherDifferent() {
56:                 final VTBackgroundStyleProperty backgroundStyleProperty = VTBackgroundFactory.eINSTANCE
57:                         .createBackgroundStyleProperty();
58:                 final VTBackgroundStyleProperty backgroundStyleProperty2 = VTBackgroundFactory.eINSTANCE
59:                         .createBackgroundStyleProperty();
60:
61:                 setEqualFields(backgroundStyleProperty, backgroundStyleProperty2);
62:                 backgroundStyleProperty2.setColor("#bbbbbb"); //$NON-NLS-1$
63:                 assertFalse(backgroundStyleProperty.equalStyles(backgroundStyleProperty2));
64:         }
65:
66:         @Test
67:         public void equalStyles_OtherNull() {
68:                 final VTBackgroundStyleProperty backgroundStyleProperty = VTBackgroundFactory.eINSTANCE
69:                         .createBackgroundStyleProperty();
70:
71:                 assertFalse(backgroundStyleProperty.equalStyles(null));
72:         }
73:
74:         private void setEqualFields(VTBackgroundStyleProperty prop1, VTBackgroundStyleProperty prop2) {
75:                 prop1.setColor("#aaaaaa"); //$NON-NLS-1$
76:                 prop2.setColor("#aaaaaa"); //$NON-NLS-1$
77:         }
78:
79: }