Package com.github.C204_242_DJSMT.Assignment_2.tests

Examples of com.github.C204_242_DJSMT.Assignment_2.tests.Tests


    new Teacher("Name");
  }
 
  @Test(expected=IllegalArgumentException.class)
  public void creationTest2() {
    new Teacher("");
  }
View Full Code Here


    new Teacher("");
  }
 
  @Test(expected=IllegalArgumentException.class)
  public void creationTest3() {
    new Teacher(null);
  }
View Full Code Here

  }
 
  @Test public void createDeleteTest() {
    Teacher t = new Teacher("Name");
    ClassGroup cls = new ClassGroup("Name", "description");
    Teaches te = TeachingManager.getInstance().add(t, cls);
    Assert.assertTrue(TeachingManager.getInstance().contains(te));
    Assert.assertTrue(TeachingManager.getInstance().delete(te));
    Assert.assertFalse(TeachingManager.getInstance().contains(te));
  }
View Full Code Here

public class TeachesTest {
  Teacher testTeacher = new Teacher("name");
  ClassGroup testClass = new ClassGroup("name", "description");
 
  @Test public void creationTest1() {
    new Teaches(testClass, testTeacher);
  }
View Full Code Here

    new Teaches(testClass, testTeacher);
  }
 
  @Test (expected=IllegalArgumentException.class)
  public void creationTest2() {
    new Teaches(null, testTeacher);
  }
View Full Code Here

    new Teaches(null, testTeacher);
  }
 
  @Test (expected=IllegalArgumentException.class)
  public void creationTest3() {
    new Teaches(testClass, null);
  }
View Full Code Here

            Document doc = docBuilder.newDocument();
            Element xTests = doc.createElement("tests");
            doc.appendChild(xTests);

            Tests exec = new Tests();

            long totalTime = 0;
            float avgTime = 0;
            int totalTests = 0;
            int passedTests = 0;
            int failedTests = 0;

            for (LinkedList<String> test : tests) {
                // copy list contents to arguments' array
                String[] testArgs = new String[ test.size() ];
                for(int i = 0; i < test.size(); ++i) testArgs[i] = test.get(i);

                // run test
                Tests.TestResult r = exec.executeCommand(testArgs);
                totalTime += r.time;
                totalTests += 1;
                if (r.ok) passedTests += 1; else failedTests += 1;

                // add test result to xml tree
View Full Code Here

TOP

Related Classes of com.github.C204_242_DJSMT.Assignment_2.tests.Tests

Copyright © 2018 www.massapicom. 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.