Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.

Paste

Pasted as Plain Text by collins ( 12 years ago )
package lapa_SWE_Blatt12_Aufgabe19;

import junit.framework.Assert;
import junit.framework.TestCase;

public class KontrolleTest extends TestCase {

 private Kontrolle ko;
 private Einfach ei;
 private Gehoben ge;
 private Bevorzugt be;
 private Frei fr;
 private Pauschal pa;
 private Premium pr;

 @Override
 protected void setUp() throws Exception {
  super.setUp();
  ko = new Kontrolle();
  ei = new Einfach();
  fr = new Frei();
  ge = new Gehoben();
  be = new Bevorzugt();
  pa = new Pauschal();
  pr = new Premium();
 }

 public void test1(){
  try {
   assertTrue(ko.zugriffErlaubt(ei, null, 101));
   fail("Keine Exception");
  } catch (Exception e) {}
 }
 
 public void test2(){
  try {
   Assert.assertTrue(ko.zugriffErlaubt(ge, fr, 59));
  } catch (Exception e) {
   // TODO: handle exception
  }
 }
 
 public void test3(){
  try {
   Assert.assertTrue(ko.zugriffErlaubt(ge, pa, 39));
  } catch (Exception e) {
   // TODO: handle exception
  }
 }
 
 public void test4(){
  try {
   Assert.assertTrue(ko.zugriffErlaubt(be, fr, 79));
  } catch (Exception e) {
   // TODO: handle exception
  }
 }
 
 public void test5(){
  try {
   Assert.assertTrue(ko.zugriffErlaubt(be, pa, 79));
  } catch (Exception e) {
   // TODO: handle exception
  }
 }
 
 public void test6(){
  try {
   Assert.assertTrue(ko.zugriffErlaubt(be, pr, 59));
  } catch (Exception e) {
   // TODO: handle exception
  }
 }
}

 

Revise this Paste

Parent: 59815
Your Name: Code Language: