Commit c419f4ee authored by Ricco Førgaard's avatar Ricco Førgaard

Sanity checked level 3.

parent 47a097e5
......@@ -2,6 +2,7 @@ package com.nesstar.tutorial;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import java.io.IOException;
import java.util.List;
......@@ -32,7 +33,7 @@ public class Level03 {
/**
* Take a Bank object that knows about studies and ask
* it to get the study with the ID "foobarbaz"
* it to get the study with the ID "NSD1907".
*
* Note the exceptions thrown!
*/
......@@ -40,38 +41,38 @@ public class Level03 {
public void getAStudyFromTheBank() throws NotAuthorizedException, IOException {
Study study = null;
assertEquals("the right label", study.getLabel());
assertTrue(study.getLabel().indexOf("health and health care") > -1);
}
/**
* Now, get the cube with the ID "cubeid".
* Now, get the cube with the ID "nedpa2012_C1".
*/
@Test
public void getACube() throws NotAuthorizedException, IOException {
Cube cube = null;
assertEquals("the right cube", cube.getLabel());
assertEquals("Netherlands: Parliamentary Election 2012", cube.getLabel());
}
/**
* You can also get users from the bank. Find the
* one with the username "leia".
* You can also get users from the bank. Get a list of all users
* on the server.
*/
@Test
public void getUser() throws NotAuthorizedException, IOException {
User user = null;
List<User> users = null;
assertEquals("Leia", user.getName());
assertEquals(5, users.size());
}
/**
* Make a list of all Studies on the server and print
* it to the console (one Study per line).
* Make a list of all variables on the server and print
* it to the console (one variable per line).
*/
@Test
public void printAllStudies() {
List<Study> allStudies = null;
public void printAllVariables() {
List<Study> allVariables = null;
assertNotNull(allStudies);
assertNotNull(allVariables);
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment