Skip to content

Package: TemplateInstanceRenderer_Test

TemplateInstanceRenderer_Test

nameinstructionbranchcomplexitylinemethod
TemplateInstanceRenderer_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%
setUp()
M: 0 C: 20
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
testCreateAddReferenceButton()
M: 0 C: 23
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 5
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: * Eugen Neufeld - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emfforms.internal.datatemplate.tooling.editor;
15:
16: import static org.junit.Assert.assertEquals;
17: import static org.mockito.Mockito.mock;
18:
19: import org.eclipse.emf.ecp.view.spi.context.ViewModelContext;
20: import org.eclipse.emf.ecp.view.spi.model.VControl;
21: import org.eclipse.emf.ecp.view.test.common.swt.spi.DatabindingClassRunner;
22: import org.eclipse.emfforms.spi.common.report.ReportService;
23: import org.eclipse.swt.widgets.Display;
24: import org.eclipse.swt.widgets.Shell;
25: import org.junit.Before;
26: import org.junit.Test;
27: import org.junit.runner.RunWith;
28:
29: @RunWith(DatabindingClassRunner.class)
30: public class TemplateInstanceRenderer_Test {
31:
32:         private TemplateInstanceRenderer renderer;
33:
34:         @Before
35:         public void setUp() throws Exception {
36:                 renderer = new TemplateInstanceRenderer(mock(VControl.class), mock(ViewModelContext.class),
37:                         mock(ReportService.class), null, null, null, null, null);
38:         }
39:
40:         @Test
41:         public void testCreateAddReferenceButton() {
42:                 final Shell shell = new Shell(Display.getDefault());
43:                 assertEquals(0, shell.getChildren().length);
44:                 renderer.createAddReferenceButton(shell, null);
45:                 assertEquals(0, shell.getChildren().length);
46:         }
47:
48: }