Skip to content

Commit

Permalink
added test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
ChiragAgg5k committed Apr 18, 2023
1 parent 77258df commit a10c2b6
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 20 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ android {
applicationId "com.chiragagg5k.bu_news_android"
minSdk 29
targetSdk 33
versionCode 10
versionName "1.5.0"
versionCode 11
versionName "1.6.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
Binary file modified app/release/app-release.aab
Binary file not shown.
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_dashboard.xml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
android:layout_marginBottom="30dp"
android:gravity="center"
android:textSize="13sp"
android:text="Made by Team Obsidian\nver. 1.5.0" />
android:text="Made by Team Obsidian\nver. 1.6.0" />

</LinearLayout>

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.chiragagg5k.bu_news_android;

import static org.junit.Assert.assertEquals;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

import java.util.ArrayList;

@RunWith(JUnit4.class)
public class UtilityUnitTest {

@Test
public void testConvertToTitleCase() {
String title = "hello world";
String expected = "Hello World";
String actual = UtilityClass.convertToTitleCase(title);
assertEquals(expected, actual);
}

@Test
public void testArrayListToString() {
ArrayList<String> arrayList = new ArrayList<>();
arrayList.add("hello");
arrayList.add("world");
String expected = "hello, world.";
String actual = UtilityClass.arrayListToString(arrayList);
assertEquals(expected, actual);
}

@Test
public void testGetDate(){
long time = 1577836800000L;
String expected = "Wednesday, 1 January";
String actual = UtilityClass.getDate(time);
assertEquals(expected, actual);
}
}

0 comments on commit a10c2b6

Please sign in to comment.