Skip to main content
summaryrefslogtreecommitdiffstats
blob: f2404c1295bcdcb75a5940ddda79a6fcb09574e1 (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
/*******************************************************************************
 * Copyright (c) 2013 Tasktop Technologies and others.
 * 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:
 *     Tasktop Technologies - initial API and implementation
 *******************************************************************************/

package org.eclipse.mylyn.bugzilla.tests.core;

import junit.framework.TestCase;

import org.eclipse.mylyn.internal.bugzilla.core.RepositoryConfiguration;

public class RepositoryConfigurationTest extends TestCase {

	private final static String PRODUCT = "product";

	RepositoryConfiguration cfg;

	@Override
	protected void setUp() throws Exception {
		cfg = new RepositoryConfiguration();
		cfg.addProduct(PRODUCT);
	}

	public void testGetUnconfirmedAllowed_product() throws Exception {
		assertFalse(cfg.getUnconfirmedAllowed(PRODUCT));
	}

	public void testGetUnconfirmedAllowed_productFalse() throws Exception {
		cfg.addUnconfirmedAllowed(PRODUCT, Boolean.FALSE);
		assertFalse(cfg.getUnconfirmedAllowed(PRODUCT));
	}

	public void testGetUnconfirmedAllowed_productNull() throws Exception {
		cfg.addUnconfirmedAllowed(PRODUCT, null);
		assertFalse(cfg.getUnconfirmedAllowed(PRODUCT));
	}

	public void testGetUnconfirmedAllowed_productTrue() throws Exception {
		cfg.addUnconfirmedAllowed(PRODUCT, Boolean.TRUE);
		assertTrue(cfg.getUnconfirmedAllowed(PRODUCT));
	}

	public void testGetUnconfirmedAllowed_noProduct() throws Exception {
		assertFalse(cfg.getUnconfirmedAllowed("no-product"));
	}
}

Back to the top