コード例 #1
0
 /** Test of copy method, of class Disjunction. */
 @Test
 public void testCopy() {
   System.out.println("copy");
   Literal l = new Literal("a");
   Literal r = new Literal("b");
   Disjunction instance = new Disjunction(l, r);
   Sentence result = instance.copy();
   assertEquals(instance, result);
 }
コード例 #2
0
 /** Test of toString method, of class Disjunction. */
 @Test
 public void testToString() {
   System.out.println("toString");
   Literal l = new Literal("a");
   Literal r = new Literal("b");
   Disjunction instance = new Disjunction(l, r);
   String expResult = "a ^ b";
   String result = instance.toString();
   assertEquals(expResult, result);
 }
コード例 #3
0
  /** Test of getArgCount method, of class Disjunction. */
  @Test
  public void testGetArgCount() {
    System.out.println("getArgCount");
    Literal l = new Literal("a");
    Literal r = new Literal("b");
    Disjunction instance = new Disjunction(l, r);
    int expResult = 2;
    int result = instance.getArgCount();
    assertEquals(expResult, result);

    Literal r2 = new Literal("c");
    instance = new Disjunction(l, r, r2);
    expResult = 3;
    result = instance.getArgCount();
    assertEquals(expResult, result);
  }
コード例 #4
0
  /** Test of getArg method, of class Disjunction. */
  @Test
  public void testGetArg() {
    System.out.println("getArg");
    Literal l = new Literal("a");
    Literal r = new Literal("b");
    Disjunction instance = new Disjunction(l, r);
    Sentence expResult = l;
    Sentence result = instance.getArg(0);
    assertEquals(expResult, result);

    expResult = r;
    result = instance.getArg(1);
    assertEquals(expResult, result);

    Literal r2 = new Literal("c");
    instance = new Disjunction(l, r, r2);
    expResult = r2;
    result = instance.getArg(2);
    assertEquals(expResult, result);
  }
コード例 #5
0
  /** Test of getValue method, of class Disjunction. */
  @Test
  public void testGetValue() {
    System.out.println("getValue0");
    Literal l = new Literal("a");
    Literal r = new Literal("b");
    Disjunction instance = new Disjunction(l, r);
    Boolean expResult = null;
    Boolean result = instance.getValue();
    assertEquals(expResult, result);

    System.out.println("getValue1");
    l = new Literal("a", true);
    r = new Literal("b", false);
    instance = new Disjunction(l, r);
    expResult = false;
    result = instance.getValue();
    assertEquals(expResult, result);

    System.out.println("getValue2");
    l = new Literal("a", true);
    r = new Literal("b", true);
    Literal r2 = new Literal("c", true);
    instance = new Disjunction(l, r, r2);
    expResult = true;
    result = instance.getValue();
    assertEquals(expResult, result);

    System.out.println("getValue3");
    l = new Literal("a", false);
    r = new Literal("b", false);
    r2 = new Literal("c", false);
    instance = new Disjunction(l, r, r2);
    expResult = false;
    result = instance.getValue();
    assertEquals(expResult, result);

    System.out.println("getValue4");
    l = new Literal("a", true);
    r = new Literal("b", true);
    r2 = new Literal("c");
    instance = new Disjunction(l, r, r2);
    expResult = null;
    result = instance.getValue();
    assertEquals(expResult, result);

    System.out.println("getValue5");
    l = new Literal("a", false);
    r = new Literal("b", true);
    r2 = new Literal("c", false);
    instance = new Disjunction(l, r, r2);
    expResult = false;
    result = instance.getValue();
    assertEquals(expResult, result);
  }