Package inheritance

Source Code of inheritance.PassengerCarTest

package inheritance;

import inheritance.PassengerCar;
import junit.framework.TestCase;
import no.hal.jex.runtime.JExercise;

@JExercise(description = "Tests inheritance.PassengerCar")
@SuppressWarnings("all")
public class PassengerCarTest extends TestCase {
  private PassengerCar pc;
 
  private PassengerCar _init_pc() {
    PassengerCar _passengerCar = new PassengerCar(3000, 200);
    return _passengerCar;
  }
 
  @Override
  protected void setUp() {
    pc = _init_pc();
   
  }
 
  @JExercise(tests = "PassengerCar(int,int);void setPassengerCount(int)", description = "Tests \n\t\tthe following sequence:\n\t\t<ul>\n\t\t<li>pc.passengerCount = 100</li>\n\t\t</ul>\n")
  public void testCheckWeight() {
    _test__checkWeight_transitions0_source_state(pc);
    _transition_exprAction__checkWeight_transitions0_actions0(pc);
    _test__checkWeight_transitions0_effect_state(pc);
   
  }
 
  private void _test__checkWeight_transitions0_source_state(final PassengerCar it) {
    _test__checkWeight_transitions0_source_state_objectTests0_test(pc);
   
  }
 
  private void _test__checkWeight_transitions0_source_state_objectTests0_test(final PassengerCar it) {
   
    int _multiply = (200 * 80);
    int _plus = (3000 + _multiply);
    int _totalWeight = this.pc.getTotalWeight();
    assertEquals("pc.totalWeight == 3000 + (200 * 80) failed after pc.passengerCount = 100", _plus, _totalWeight);
   
  }
 
  private void _transition_exprAction__checkWeight_transitions0_actions0(final PassengerCar it) {
    try {
     
      this.pc.setPassengerCount(100);
      } catch (junit.framework.AssertionFailedError error) {
      fail("pc.passengerCount = 100 failed: " + error.getMessage());
    }
   
  }
 
  private void _test__checkWeight_transitions0_effect_state(final PassengerCar it) {
    _test__checkWeight_transitions0_effect_state_objectTests0_test(pc);
   
  }
 
  private void _test__checkWeight_transitions0_effect_state_objectTests0_test(final PassengerCar it) {
   
    int _passengerCount = this.pc.getPassengerCount();
    assertEquals("pc.passengerCount == 100 failed after pc.passengerCount = 100", 100, _passengerCount);
   
    int _multiply = (100 * 80);
    int _plus = (3000 + _multiply);
    int _totalWeight = this.pc.getTotalWeight();
    assertEquals("pc.totalWeight == 3000 + (100 * 80) failed after pc.passengerCount = 100", _plus, _totalWeight);
   
  }
 
  public static void main(final String[] args) {
    no.hal.jex.standalone.JexStandalone.main(PassengerCarTest.class);
  }
}
TOP

Related Classes of inheritance.PassengerCarTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.