Finished initial conversion of WebApiConnection to use Firebase. Need to update LogManager to use string IDs to make it compatible.
This commit is contained in:
@@ -15,20 +15,14 @@ import java.util.TimeZone;
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
@Config(sdk = {Build.VERSION_CODES.O_MR1}, packageName = "uk.org.openseizuredetector")
|
||||
public class LogManagerTest extends TestCase {
|
||||
LogManager mLm;
|
||||
public void setUp() throws Exception {
|
||||
super.setUp();
|
||||
TimeZone.setDefault(TimeZone.getTimeZone("America/Los_Angeles"));
|
||||
mLm = new LogManager(RuntimeEnvironment.systemContext);
|
||||
}
|
||||
|
||||
|
||||
public void tearDown() throws Exception {
|
||||
mLm.close();
|
||||
|
||||
}
|
||||
|
||||
SdData getFakeSdData() {
|
||||
SdData sdData = new SdData();
|
||||
return sdData;
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
package uk.org.openseizuredetector;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.core.app.ApplicationProvider;
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
|
||||
import com.google.firebase.FirebaseApp;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.robolectric.RobolectricTestRunner;
|
||||
|
||||
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
public class WebApiConnectionTest {
|
||||
WebApiConnection mWac;
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
Context context = ApplicationProvider.getApplicationContext();
|
||||
FirebaseApp.initializeApp(context);
|
||||
mWac = new WebApiConnection(context);
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown() throws Exception {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void isLoggedIn() {
|
||||
assertTrue(mWac.isLoggedIn());
|
||||
assertFalse(mWac.isLoggedIn());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void createEvent() {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getEvent() {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getEvents() {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void updateEvent() {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void createDatapoint() {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getUserProfile() {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user