Skip to main content
summaryrefslogtreecommitdiffstats
blob: ba2a8c091adb4c81534b33d6361cd45aa1c76780 (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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/*******************************************************************************
 * Copyright (c) 2013 Boeing.
 * 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:
 *     Boeing - initial API and implementation
 *******************************************************************************/
package org.eclipse.osee.ats.dsl.integration.internal.model;

import org.junit.Assert;
import org.eclipse.osee.ats.api.workdef.WidgetOption;
import org.eclipse.osee.ats.dsl.integration.internal.model.WidgetDefinition;
import org.junit.Test;

/**
 * Test case for {@link WidgetDefinition}
 *
 * @author Donald G. Dunne
 */
public class WidgetDefinitionTest {

   @Test
   public void testGetSetDescription() {
      WidgetDefinition item = new WidgetDefinition("review");
      Assert.assertEquals(null, item.getDescription());
      item.setDescription("desc");
      Assert.assertEquals("desc", item.getDescription());
   }

   @Test
   public void testToString() {
      WidgetDefinition item = new WidgetDefinition("review");
      Assert.assertEquals("[review][null]", item.toString());
   }

   @Test
   public void testGetSetAttribute() {
      WidgetDefinition item = new WidgetDefinition("review");
      Assert.assertEquals(null, item.getAtrributeName());
      item.setAttributeName("desc");
      Assert.assertEquals("desc", item.getAtrributeName());
   }

   @Test
   public void testGetSetTooltip() {
      WidgetDefinition item = new WidgetDefinition("review");
      Assert.assertEquals(null, item.getToolTip());
      item.setToolTip("desc");
      Assert.assertEquals("desc", item.getToolTip());
   }

   @Test
   public void testGetSetWidgetname() {
      WidgetDefinition item = new WidgetDefinition("review");
      Assert.assertEquals(null, item.getXWidgetName());
      item.setXWidgetName("desc");
      Assert.assertEquals("desc", item.getXWidgetName());
   }

   @Test
   public void testGetSetDefaultName() {
      WidgetDefinition item = new WidgetDefinition("review");
      Assert.assertEquals(null, item.getDefaultValue());
      item.setDefaultValue("desc");
      Assert.assertEquals("desc", item.getDefaultValue());
   }

   @Test
   public void testGetSetHeight() {
      WidgetDefinition item = new WidgetDefinition("review");
      Assert.assertEquals(0, item.getHeight());
      item.setHeight(4);
      Assert.assertEquals(4, item.getHeight());
   }

   @Test
   public void testSet() {
      WidgetDefinition item = new WidgetDefinition("review");
      Assert.assertFalse(item.is(WidgetOption.ALIGN_CENTER));
      item.set(WidgetOption.ALIGN_CENTER);
      Assert.assertTrue(item.is(WidgetOption.ALIGN_CENTER));
   }

}

Back to the top