Skip to content

Instantly share code, notes, and snippets.

View ZieIony's full-sized avatar

ZieIony

View GitHub Profile
package com.example
import android.content.Context
import android.graphics.BitmapFactory
import android.graphics.Canvas
import android.graphics.Paint
import android.graphics.PointF
import android.util.AttributeSet
import android.view.MotionEvent
import android.view.View
@Test
fun testProperties() {
val fileContent = """
slack.token=asdf
""".trimIndent()
val properties = Properties()
properties.load(ByteArrayInputStream(fileContent.toByteArray()))
val toolsProperties = ToolsProperties.parseProperties(properties)
const val PROPERTY_SLACK_TOKEN = "slack.token"
data class ToolsProperties(
val slackToken: String,
) {
companion object {
fun parseProperties(propertiesFileName: String): ToolsProperties {
val properties = Properties()
val stream = FileInputStream(propertiesFileName)
properties.load(stream)
const val PROPERTY_SLACK_TOKEN = "slack.token"
data class ToolsProperties(
val slackToken: String,
)
internal fun parseProperties(propertiesFileName: String): ToolsProperties? {
val properties = Properties()
val stream = FileInputStream(propertiesFileName)
properties.load(stream)
fun myFunction(input: Int):Int {
return input * 2
}
@Test
fun simpleTest() {
val testInput = 2
val testOutput = 4
assertEquals(testOutput, myFunction(testInput))
fun myFunction(input: Int):Int {
return input * 2
}
fun simpleTest() {
val testInput = 2
val testOutput = 4
if (myFunction(testInput) != testOutput)
// test failed
}
fun testLogin() {
given {
user sees { loginScreen() }
} whenever {
user clicks {
loginButton()
} and {
password is correct
}
} then {
package com.github.zieIony.dots
import android.animation.ArgbEvaluator
import android.animation.ObjectAnimator
import android.animation.ValueAnimator
import android.content.Context
import android.graphics.Canvas
import android.graphics.Paint
import android.graphics.Path
import android.os.Bundle
class Control {
void measure();
void layout(float x, float y, float width, float height);
void draw();
void dispatchMouseEvent(MouseEvent event);
}
class ControlGroup {
List<Control> children;
class Button {
Color background;
Content content;
float x, y, width, height;
OnClickListener clickListener;
void measure() {
// compute preferred size
}