F5: README completo (admob/keystore/BD), AGENTS.md nuevo, versionName 1.4.0, tests reales + junit, fix lint RTL
This commit is contained in:
1 parent
a003a94e7a
commit
4a4ed7162d
8 files changed
+163
-55
No files matched your search
-26
@@ -1,26 +0,0 @@
|
||||
package com.jkanetwork.st.calendariodefrases;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.test.InstrumentationRegistry;
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumentation test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() throws Exception {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getTargetContext();
|
||||
|
||||
assertEquals("com.jkanetwork.st.unafrasealdia", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
@@ -72,8 +72,8 @@
|
||||
android:layout_gravity="top"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="end"
|
||||
android:text="(Aqui autor)"
|
||||
android:textAlignment="textEnd"
|
||||
android:textColor="#222" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.jkanetwork.st.calendariodefrases;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
/**
|
||||
* Tests de las partes de lógica pura (sin Android framework).
|
||||
*/
|
||||
public class DayKeyTest {
|
||||
|
||||
@Test
|
||||
public void todayKey_formato_yyyymmdd() {
|
||||
String key = new SimpleDateFormat("yyyyMMdd", Locale.US).format(new Date());
|
||||
Calendar cal = Calendar.getInstance();
|
||||
String expected = String.format(Locale.US, "%04d%02d%02d",
|
||||
cal.get(Calendar.YEAR), cal.get(Calendar.MONTH) + 1, cal.get(Calendar.DAY_OF_MONTH));
|
||||
assertEquals(expected, key);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void dayKey_comparacionLexicografica_funcionaComoFecha() {
|
||||
// La lógica de getIDFraseDay compara diaArg vs hoy como strings: debe
|
||||
// mantenerse el orden cronológico.
|
||||
assertTrue("20261020".compareTo("20261019") > 0);
|
||||
assertTrue("20261101".compareTo("20261031") > 0);
|
||||
assertTrue("20270101".compareTo("20261231") > 0);
|
||||
}
|
||||
|
||||
private static void assertTrue(boolean b) {
|
||||
org.junit.Assert.assertTrue(b);
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.jkanetwork.st.calendariodefrases;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() throws Exception {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user