Ejemplo n.º 1
0
 @Test
 public void testPopulateDrugStrengthNormalInput() {
   Drug d = new Drug();
   DrugTo1 t = new DrugTo1();
   t.setStrengthUnit("mg");
   t.setStrength((float) 100);
   Boolean result = this.populateDrugStrength(d, t);
   assertEquals("100.0 mg", d.getDosage());
   assertEquals("mg", d.getUnit());
   assertTrue(result);
 }
Ejemplo n.º 2
0
  @Test
  public void testPopulateDrugStrengthNoStrengthInfo() {
    Drug d = new Drug();
    d.setBrandName("aspirin");

    DrugTo1 t = new DrugTo1();

    Boolean result = this.populateDrugStrength(d, t);

    assertEquals("1.0 mg", d.getDosage());
    assertEquals("mg", d.getUnit());
    assertTrue(result);
  }