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:
Graham Jones
2022-03-18 21:01:59 +00:00
parent 542fc42e5d
commit f509e470d4
5 changed files with 201 additions and 386 deletions

View File

@@ -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;
}

View File

@@ -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() {
}
}