This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>UTExportedTypeDeclarations</key> | |
<array> | |
<dict> | |
<key>UTTypeConformsTo</key> | |
<array> | |
<string>public.data</string> |
This file contains hidden or 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
Film | Genre | Lead Studio | Audience score | Profitability | Rotten Tomatoes | Worldwide Gross | Year | |
---|---|---|---|---|---|---|---|---|
Zack and Miri Make a Porno | Romance | The Weinstein Company | 70 | 1.747541667 | 64 | $41.94 | 2008 | |
Youth in Revolt | Comedy | The Weinstein Company | 52 | 1.09 | 68 | $19.62 | 2010 | |
You Will Meet a Tall Dark Stranger | Comedy | Independent | 35 | 1.211818182 | 43 | $26.66 | 2010 | |
When in Rome | Comedy | Disney | 44 | 0 | 15 | $43.04 | 2010 | |
What Happens in Vegas | Comedy | Fox | 72 | 6.267647029 | 28 | $219.37 | 2008 | |
Water For Elephants | Drama | 20th Century Fox | 72 | 3.081421053 | 60 | $117.09 | 2011 | |
WALL-E | Animation | Disney | 89 | 2.896019067 | 96 | $521.28 | 2008 | |
Waitress | Romance | Independent | 67 | 11.0897415 | 89 | $22.18 | 2007 | |
Waiting For Forever | Romance | Independent | 53 | 0.005 | 6 | $0.03 | 2011 |
This file contains hidden or 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
object TimeStampSurrogateSerializer : KSerializer<Timestamp> { | |
override val descriptor: SerialDescriptor = TimestampSurrogate.serializer().descriptor | |
override fun serialize(encoder: Encoder, value: Timestamp) { | |
val surrogate = TimestampSurrogate(value.date.getAsTime()) | |
encoder.encodeSerializableValue(TimestampSurrogate.serializer(), surrogate) | |
} | |
override fun deserialize(decoder: Decoder): Timestamp { | |
val surrogate = decoder.decodeSerializableValue(TimestampSurrogate.serializer()) | |
return Timestamp(Date(surrogate.timeInMillis)) |
This file contains hidden or 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
// Third party data class that can't be changed | |
data class Timestamp(val date: Date) | |
@Serializable | |
@SerialName("Timestamp") | |
private class TimestampSurrogate(val timeInMillis: Long) |
This file contains hidden or 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
@Serializable | |
data class MyClass( | |
val name: String, | |
@Serializable(with = TimestampAsLongSerializable::class) | |
val timestamp: Timestamp | |
) |
This file contains hidden or 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
object TimeStampAsLongSerializer : KSerializer<Timestamp> { | |
override val descriptor: SerialDescriptor = PrimitiveSerialDescriptor("Date", PrimitiveKind.LONG) | |
override fun serialize(encoder: Encoder, value: Timestamp) { | |
encoder.encodeLong(value.timeInMillis) | |
} | |
override fun deserialize(decoder: Decoder): Timestamp { | |
return Timestamp(decoder.decodeLong()) | |
} | |
} |
This file contains hidden or 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
// Third party data class that we cannot change | |
data class Timestamp(val timeInMillis: Long) |
This file contains hidden or 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
open class MockTestRunner : AndroidJUnitRunner() { | |
override fun onCreate(arguments: Bundle?) { | |
StrictMode.setThreadPolicy(StrictMode.ThreadPolicy.Builder().permitAll().build()) | |
super.onCreate(arguments) | |
} | |
override fun newApplication(cl: ClassLoader?, className: String?, context: Context?): Application { | |
return super.newApplication(cl, TestHomeApplication::class.java.name, context) | |
} |
This file contains hidden or 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
class TestHomeApplication: HomeApplication { // make HomeApplication open at this point | |
override fun onCreate() { | |
super.onCreate() | |
koinApplication.modules(testModule) | |
} | |
} | |
val testModule = module { |
This file contains hidden or 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
... | |
@Before | |
override fun setup() { | |
val realInteractor = get<HomeInteractor>() | |
mockedInteractor = Mockito.spy(realInteractor) | |
mockedModule = module { | |
single(override = true) { mockedInteractor } | |
} | |
loadKoinModules(mockModule) |
NewerOlder