@@ -0,0 +1,2493 @@
+/*%0A * This Source Code Form is subject to the terms of the Mozilla Public%0A * License, v. 2.0. If a copy of the MPL was not distributed with this%0A * file, You can obtain one at http://mozilla.org/MPL/2.0/.%0A */%0A%0Apackage be.hyperrail.android.test;%0A%0Aimport android.support.test.InstrumentationRegistry;%0Aimport android.support.test.runner.AndroidJUnit4;%0A%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0A%0Aimport be.hyperrail.android.irail.contracts.IrailStationProvider;%0Aimport be.hyperrail.android.irail.db.Station;%0Aimport be.hyperrail.android.irail.db.StationsDb;%0A%0Aimport static junit.framework.Assert.assertEquals;%0A%0A@RunWith(AndroidJUnit4.class)%0Apublic class StationsDbInstrumentedTest %7B%0A%0A    IrailStationProvider provider = new StationsDb(InstrumentationRegistry.getTargetContext());%0A%0A    @Test%0A    public void testStationSearch()%7B%0A        //BE.NMBS.008811437 %09Bosvoorde/Boitsfort %09Boitsfort %09Bosvoorde %09%09%09be %094.408112 %0950.794698 %0931.947976878613%0A        Station bosvoorde = provider.getStationById(%22BE.NMBS.008811437%22);%0A        assertEquals(%22BE.NMBS.008811437%22, bosvoorde.getId());%0A        assertEquals(%22Bosvoorde/Boitsfort%22, bosvoorde.getName());%0A        assertEquals(%22Bosvoorde%22, bosvoorde.getAlternativeNl());%0A        assertEquals(%22Boitsfort%22, bosvoorde.getAlternativeFr());%0A        assertEquals(%22%22, bosvoorde.getAlternativeEn());%0A        assertEquals(%22%22, bosvoorde.getAlternativeDe());%0A        assertEquals(%22be%22, bosvoorde.getCountryCode());%0A        assertEquals(4.408112, bosvoorde.getLongitude(),0.0000001);%0A        assertEquals(50.794698, bosvoorde.getLatitude(),0.0000001);%0A        assertEquals(%0931.947976878613, bosvoorde.getAvgStopTimes(),0.0001);%0A%0A        // Test for caps variations, different languages, and diferent separator symbols%0A        String searchnames%5B%5D = new String%5B%5D%7B%22Bosvoorde%22,%22Boitsfort%22,%22Bosvoorde/Boitsfort%22,%22Bosvoorde Boitsfort%22,%22Bosvoorde-Boitsfort%22,%22BOSVOORDE%22%7D;%0A        for (String name :searchnames) %7B%0A            assertEquals(bosvoorde.getId(),provider.getStationByName(name).getId());%0A        %7D%0A        // BE.NMBS.008866001 %09Arlon %09%09Aarlen %09Arel%0A        Station arlon = provider.getStationById(%22BE.NMBS.008866001%22);%0A        assertEquals(%22BE.NMBS.008866001%22, arlon.getId());%0A        assertEquals(%22Arlon%22, arlon.getName());%0A        assertEquals(%22Aarlen%22, arlon.getAlternativeNl());%0A        assertEquals(%22%22, arlon.getAlternativeFr());%0A        assertEquals(%22%22, arlon.getAlternativeEn());%0A        assertEquals(%22Arel%22, arlon.getAlternativeDe());%0A%0A    %7D%0A%7D%0A

Add some simple unit tests for station database