Skip to main content
summaryrefslogtreecommitdiffstats
blob: 8a0624fd87a573e5b0907718ed3cb90ecb70b327 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*******************************************************************************
 * Copyright (c) 2012 Obeo.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 *     Obeo - initial API and implementation
 *******************************************************************************/
package org.eclipse.emf.compare.tests.unit;

import static junit.framework.Assert.assertNull;
import static junit.framework.Assert.assertSame;

import org.eclipse.emf.compare.DifferenceKind;
import org.junit.Test;

/**
 * Tests the behavior of the {@link DifferenceKind} enumeration.
 * 
 * @generated
 */
@SuppressWarnings("nls")
public class DifferenceKindTest {
	/**
	 * Tests the behavior of the {@link DifferenceKind#get(int)} method.
	 * 
	 * @generated
	 */
	@Test
	public void testGetInt() {
		int highestValue = -1;
		for (DifferenceKind value : DifferenceKind.VALUES) {
			assertSame(DifferenceKind.get(value.getValue()), value);
			if (value.getValue() > highestValue) {
				highestValue = value.getValue();
			}
		}
		assertNull(DifferenceKind.get(++highestValue));
	}

	/**
	 * Tests the behavior of the {@link DifferenceKind#get(java.lang.String)} method.
	 * 
	 * @generated
	 */
	@Test
	public void testGetString() {
		for (DifferenceKind value : DifferenceKind.VALUES) {
			assertSame(DifferenceKind.get(value.getLiteral()), value);
		}
		assertNull(DifferenceKind.get("ThisIsNotAValueOfTheTestedEnum"));
	}

	/**
	 * Tests the behavior of the {@link DifferenceKind#getByName(java.lang.String)} method.
	 * 
	 * @generated
	 */
	@Test
	public void testGetByName() {
		for (DifferenceKind value : DifferenceKind.VALUES) {
			assertSame(DifferenceKind.getByName(value.getName()), value);
		}
		assertNull(DifferenceKind.getByName("ThisIsNotTheNameOfAValueFromTheTestedEnum"));
	}
}

Back to the top