mirror of
https://github.com/NiciDieNase/chaosflix
synced 2025-02-17 05:28:24 +00:00
fix indentation in Tests
This commit is contained in:
parent
40eda2516b
commit
2e77d02e73
1 changed files with 35 additions and 23 deletions
|
@ -2,15 +2,19 @@ package de.nicidienase.chaosflix;
|
|||
|
||||
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import de.nicidienase.chaosflix.entities.Conference;
|
||||
|
@ -28,64 +32,72 @@ import retrofit2.Response;
|
|||
|
||||
public class MediaCCCClientTest{
|
||||
|
||||
private static final String TAG = MediaCCCClientTest.class.getSimpleName();
|
||||
private MediaCCCClient client;
|
||||
|
||||
@Before
|
||||
public void beforeTest(){
|
||||
this.client = new MediaCCCClient();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getConferenceTest() throws IOException {
|
||||
Conference conference = new MediaCCCClient().getConference(101).execute().body();
|
||||
assertEquals(conference.getAcronym(),"33c3");
|
||||
Conference conference = client.getConference(101).execute().body();
|
||||
assertEquals(conference.getAcronym(),"33c3");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getEventTest() throws IOException {
|
||||
Event event = new MediaCCCClient().getEvent(3674).execute().body();
|
||||
assertEquals(event.getGuid(),"bfc2ab1f-8384-4d7d-801a-dde8c81e039c");
|
||||
Event event = this.client.getEvent(3674).execute().body();
|
||||
assertEquals(event.getGuid(),"bfc2ab1f-8384-4d7d-801a-dde8c81e039c");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getEventRecordingsTest() throws IOException {
|
||||
Event event = new MediaCCCClient().getEvent(3674).execute().body();
|
||||
assertEquals(event.getRecordings().size(),9);
|
||||
Event event = this.client.getEvent(3674).execute().body();
|
||||
assertEquals(event.getRecordings().size(),9);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void getRecordingTest() throws IOException {
|
||||
Recording recording = new MediaCCCClient().getRecording(14142).execute().body();
|
||||
assertEquals(recording.getUpdatedAt(), "2016-12-29T03:16:16.105+01:00");
|
||||
Recording recording = this.client.getRecording(14142).execute().body();
|
||||
assertEquals(recording.getUpdatedAt(), "2016-12-29T03:16:16.105+01:00");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getConferencEventListTest() throws IOException {
|
||||
Conferences conferences = new MediaCCCClient().listConferences().execute().body();
|
||||
assertEquals(99,conferences.getConferences().size());
|
||||
Conferences conferences = this.client.listConferences().execute().body();
|
||||
assertEquals(99,conferences.getConferences().size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void eventTagsTest() throws IOException {
|
||||
Conference conference = new MediaCCCClient().getConference(101).execute().body();
|
||||
assertEquals(12,conference.getEventsByTags().keySet().size());
|
||||
Conference conference = this.client.getConference(101).execute().body();
|
||||
assertEquals(12,conference.getEventsByTags().keySet().size());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void sortTest() throws IOException {
|
||||
final MediaCCCClient client = new MediaCCCClient();
|
||||
Conferences conferences = client.listConferences().execute().body();
|
||||
Collections.sort(conferences.getConferences());
|
||||
for (Conference conf : conferences.getConferences()) {
|
||||
List<Event> events =
|
||||
client.getConference(conf.getApiID()).execute().body().getEvents();
|
||||
Collections.sort(events);
|
||||
}
|
||||
final MediaCCCClient client = this.client;
|
||||
Conferences conferences = client.listConferences().execute().body();
|
||||
Collections.sort(conferences.getConferences());
|
||||
for (Conference conf : conferences.getConferences()) {
|
||||
List<Event> events =
|
||||
client.getConference(conf.getApiID()).execute().body().getEvents();
|
||||
Collections.sort(events);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void sortAllEvents() throws IOException {
|
||||
MediaCCCClient client = new MediaCCCClient();
|
||||
Collections.sort(client.getEvents().execute().body());
|
||||
MediaCCCClient client = this.client;
|
||||
Collections.sort(client.getEvents().execute().body());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void mrmcd13() throws IOException {
|
||||
MediaCCCClient client = new MediaCCCClient();
|
||||
MediaCCCClient client = this.client;
|
||||
Conference conference = client.getConference(38).execute().body();
|
||||
ArrayList<String> keyList = Lists.newArrayList(conference.getEventsByTags().keySet());
|
||||
Collections.sort(keyList);
|
||||
|
|
Loading…
Add table
Reference in a new issue