Skip to content

Instantly share code, notes, and snippets.

@elye
elye / Android_Kotlin_TestRuleFlow
Created August 21, 2018 22:58
Experimenting TestRule Flow
package com.elyeproj.testrules
import org.junit.After
import org.junit.AfterClass
import org.junit.Before
import org.junit.BeforeClass
import org.junit.ClassRule
import org.junit.Rule
import org.junit.Test
import org.junit.rules.TestRule
@elye
elye / Kotlin Date Iterator
Last active July 15, 2021 22:10
Kotlin Date Iterator
class TestingClass {
fun testingFunction() {
for (everyday in this year 2017) {
// Do something with everyday
println(everyday.toString())
}
}
private infix fun year(year: Int): DateRange {
return Date(year, 1, 1)..Date(year, 12, 31)
ext {
appVersionName = '1.0'
appPackageId = '<YourApplicationID>'
}
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "<YourApplicationID>"
minSdkVersion 19
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"