01: package org.eclipse.core.tests.internal.databinding;
02:
03: import junit.framework.TestCase;
04:
05: import org.eclipse.core.internal.databinding.BindingMessages;
06:
07: /*******************************************************************************
08: * Copyright (c) 2007 IBM Corporation and others.
09: * All rights reserved. This program and the accompanying materials
10: * are made available under the terms of the Eclipse Public License v1.0
11: * which accompanies this distribution, and is available at
12: * http://www.eclipse.org/legal/epl-v10.html
13: *
14: * Contributors:
15: * IBM Corporation - initial API and implementation
16: ******************************************************************************/
17:
18: /**
19: * @since 3.2
20: *
21: */
22: public class BindingMessagesTest extends TestCase {
23: public void testFormatString() throws Exception {
24: String key = "Validate_NumberOutOfRangeError";
25: String result = BindingMessages.formatString(key, new Object[] {
26: "1", "2" });
27: assertFalse("key should not be returned", key.equals(result));
28: }
29:
30: public void testFormatStringForKeyNotFound() throws Exception {
31: String key = "key_that_does_not_exist";
32: String result = BindingMessages.formatString(key, null);
33: assertTrue(key.equals(result));
34: }
35: }
|