mirror of
https://github.com/MinimalBible/MinimalBible
synced 2025-08-28 02:04:46 -04:00
Code coverage is working!
Been trying so long to get this running, so happy to have it done.
This commit is contained in:
@ -1,12 +1,9 @@
|
||||
buildscript {
|
||||
ext.kotlin_version = '0.9.206'
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.12.+'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,39 +0,0 @@
|
||||
package org.bspeice.minimalbible.test;
|
||||
|
||||
import org.bspeice.minimalbible.MBTestCase;
|
||||
import org.bspeice.minimalbible.SafeValDelegate;
|
||||
|
||||
import kotlin.PropertyMetadataImpl;
|
||||
|
||||
/**
|
||||
* Test that the FinalDelegate actually obeys its contract
|
||||
*/
|
||||
public class SafeValDelegateTest extends MBTestCase {
|
||||
|
||||
SafeValDelegate<String> delegate;
|
||||
|
||||
public void setUp() {
|
||||
delegate = new SafeValDelegate<String>();
|
||||
}
|
||||
|
||||
public void testDelegateNullSafety() {
|
||||
try {
|
||||
delegate.get(null, new PropertyMetadataImpl(""));
|
||||
} catch (IllegalStateException e) {
|
||||
return;
|
||||
}
|
||||
|
||||
fail("Exception not thrown!");
|
||||
}
|
||||
|
||||
public void testDelegateAssignOnce() {
|
||||
try {
|
||||
delegate.set(null, new PropertyMetadataImpl(""), "");
|
||||
delegate.set(null, new PropertyMetadataImpl(""), "");
|
||||
} catch (IllegalStateException e) {
|
||||
return;
|
||||
}
|
||||
|
||||
fail("Allowed to set twice!");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user