Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions path/to/app/src/main/java/be/scri/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# complete code
import androidx.core.util.*

class MainActivity : AppCompatActivity() {
private val outreachManager: OutreachManager = OutreachManager(this)

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
outreachManager.postOnSocialMedia()
outreachManager.postOnForums()
outreachManager.postOnLanguageInstitutions()
}
}
22 changes: 22 additions & 0 deletions path/to/app/src/main/java/be/scri/helpers/Constants.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# complete code
import androidx.core.util.*

class Constants(private val context: Context) {
companion object {
const val OUTREACH_SOCIAL_MEDIA_URL = "https://wikis.world/@scribe"
const val OUTREACH_FORUM_URL = "https://news.ycombinator.com/"
const val OUTREACH_LANGUAGE_INSTITUTIONS_URL = "https://www.goethe.de/de/index.html"
}

fun getOutreachSocialMediaUrl(): String {
return OUTREACH_SOCIAL_MEDIA_URL
}

fun getOutreachForumUrl(): String {
return OUTREACH_FORUM_URL
}

fun getOutreachLanguageInstitutionsUrl(): String {
return OUTREACH_LANGUAGE_INSTITUTIONS_URL
}
}
25 changes: 25 additions & 0 deletions path/to/app/src/main/java/be/scri/helpers/ConstantsTest.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# complete code
import org.junit.Assert.*

class ConstantsTest {
@Test
fun testGetOutreachSocialMediaUrl() {
val context = Application()
val constants = Constants(context)
assertEquals(Constants.OUTREACH_SOCIAL_MEDIA_URL, constants.getOutreachSocialMediaUrl())
}

@Test
fun testGetOutreachForumUrl() {
val context = Application()
val constants = Constants(context)
assertEquals(Constants.OUTREACH_FORUM_URL, constants.getOutreachForumUrl())
}

@Test
fun testGetOutreachLanguageInstitutionsUrl() {
val context = Application()
val constants = Constants(context)
assertEquals(Constants.OUTREACH_LANGUAGE_INSTITUTIONS_URL, constants.getOutreachLanguageInstitutionsUrl())
}
}
10 changes: 10 additions & 0 deletions path/to/app/src/main/java/be/scri/helpers/OutreachForums.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# complete code
import androidx.core.util.*

class OutreachForums(private val context: Context) {
private val outreachManager: OutreachManager = OutreachManager(context)

fun postOnForums() {
outreachManager.postOnForums()
}
}
14 changes: 14 additions & 0 deletions path/to/app/src/main/java/be/scri/helpers/OutreachForumsTest.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# complete code
import org.junit.Assert.*
import org.junit.Test
import org.mockito.Mockito.*

class OutreachForumsTest {
@Test
fun testPostOnForums() {
val context = Application()
val outreachForums = OutreachForums(context)
outreachForums.postOnForums()
verify(outreachForums).postOnForums()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# complete code
import androidx.core.util.*

class OutreachLanguageInstitutions(private val context: Context) {
private val outreachManager: OutreachManager = OutreachManager(context)

fun postOnLanguageInstitutions() {
outreachManager.postOnLanguageInstitutions()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# complete code
import org.junit.Assert.*
import org.junit.Test
import org.mockito.Mockito.*

class OutreachLanguageInstitutionsTest {
@Test
fun testPostOnLanguageInstitutions() {
val context = Application()
val outreachLanguageInstitutions = OutreachLanguageInstitutions(context)
outreachLanguageInstitutions.postOnLanguageInstitutions()
verify(outreachLanguageInstitutions).postOnLanguageInstitutions()
}
}
24 changes: 24 additions & 0 deletions path/to/app/src/main/java/be/scri/helpers/OutreachManager.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# complete code
import androidx.core.util.*

class OutreachManager(private val context: Context) {
private val constants: Constants = Constants(context)

fun postOnSocialMedia() {
val url = constants.getOutreachSocialMediaUrl()
// Implement social media posting logic here
println("Posting on social media: $url")
}

fun postOnForums() {
val url = constants.getOutreachForumUrl()
// Implement forum posting logic here
println("Posting on forums: $url")
}

fun postOnLanguageInstitutions() {
val url = constants.getOutreachLanguageInstitutionsUrl()
// Implement language institution posting logic here
println("Posting on language institutions: $url")
}
}
36 changes: 36 additions & 0 deletions path/to/app/src/main/java/be/scri/helpers/OutreachManagerTest.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# complete code
import org.junit.Assert.*
import org.junit.Test
import org.mockito.Mockito.*

class OutreachManagerTest {
@Test
fun testPostOnSocialMedia() {
val context = Application()
val constants = Constants(context)
val outreachManager = OutreachManager(context)
val socialMediaUrl = constants.getOutreachSocialMediaUrl()
outreachManager.postOnSocialMedia()
verify(outreachManager).postOnSocialMedia()
}

@Test
fun testPostOnForums() {
val context = Application()
val constants = Constants(context)
val outreachManager = OutreachManager(context)
val forumUrl = constants.getOutreachForumUrl()
outreachManager.postOnForums()
verify(outreachManager).postOnForums()
}

@Test
fun testPostOnLanguageInstitutions() {
val context = Application()
val constants = Constants(context)
val outreachManager = OutreachManager(context)
val languageInstitutionsUrl = constants.getOutreachLanguageInstitutionsUrl()
outreachManager.postOnLanguageInstitutions()
verify(outreachManager).postOnLanguageInstitutions()
}
}
10 changes: 10 additions & 0 deletions path/to/app/src/main/java/be/scri/helpers/OutreachSocialMedia.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# complete code
import com.google.android.gms:play-services-social:*

class OutreachSocialMedia(private val context: Context) {
private val outreachManager: OutreachManager = OutreachManager(context)

fun postOnSocialMedia() {
outreachManager.postOnSocialMedia()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# complete code
import org.junit.Assert.*
import org.junit.Test
import org.mockito.Mockito.*

class OutreachSocialMediaTest {
@Test
fun testPostOnSocialMedia() {
val context = Application()
val outreachSocialMedia = OutreachSocialMedia(context)
outreachSocialMedia.postOnSocialMedia()
verify(outreachSocialMedia).postOnSocialMedia()
}
}
16 changes: 16 additions & 0 deletions path/to/app/src/main/java/be/scri/helpers/OutreachUtils.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# complete code
import androidx.core.util.*

object OutreachUtils {
fun getOutreachSocialMediaUrl(): String {
return Constants.OUTREACH_SOCIAL_MEDIA_URL
}

fun getOutreachForumUrl(): String {
return Constants.OUTREACH_FORUM_URL
}

fun getOutreachLanguageInstitutionsUrl(): String {
return Constants.OUTREACH_LANGUAGE_INSTITUTIONS_URL
}
}
Loading