-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
77258df
commit a10c2b6
Showing
5 changed files
with
42 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 0 additions & 17 deletions
17
app/src/test/java/com/chiragagg5k/bu_news_android/ExampleUnitTest.java
This file was deleted.
Oops, something went wrong.
39 changes: 39 additions & 0 deletions
39
app/src/test/java/com/chiragagg5k/bu_news_android/UtilityUnitTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |