Skip to content

Package: Preview_Test

Preview_Test

nameinstructionbranchcomplexitylinemethod
Preview_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%
testRenderNullView()
M: 0 C: 21
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: * alex - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.view.model.preview.common.test;
15:
16: import static org.mockito.Mockito.mock;
17: import static org.mockito.Mockito.when;
18:
19: import org.eclipse.emf.ecp.view.model.preview.common.Preview;
20: import org.eclipse.swt.widgets.Composite;
21: import org.eclipse.swt.widgets.Control;
22: import org.junit.Test;
23:
24: /**
25: * Unit tests for the {@link Preview}.
26: */
27: public class Preview_Test {
28:
29:         @Test(expected = Test.None.class /* no exception expected */)
30:         public void testRenderNullView() {
31:                 final Composite parent = mock(Composite.class);
32:                 when(parent.getChildren()).thenReturn(new Control[0]);
33:                 final Preview preview = new Preview(parent);
34:                 preview.render(null, null);
35:         }
36:
37: }