Advertisement
Guest User

Untitled

a guest
Jun 29th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.55 KB | None | 0 0
  1. @RunWith(AndroidJUnit4::class)
  2. class ExampleInstrumentedTest {
  3.  
  4. val store = Store()
  5.  
  6. @Test
  7. fun storeObject() {
  8. val calendar = Calendar.getInstance()
  9. val key = "object"
  10. store.setObject(key, calendar)
  11. assertSame(calendar, store.getObject(key))
  12. }
  13.  
  14. @Test
  15. fun storeFloatEquals() {
  16. val float = 3f
  17. val key = "float"
  18. store.setFloat(key, float)
  19. assertEquals(float, store.getFloat(key))
  20. }
  21.  
  22. @Test
  23. fun storeIntegerEquals() {
  24. val int = 3
  25. val key = "int"
  26. store.setInteger(key, int)
  27. assertEquals(int, store.getInteger(key))
  28. }
  29.  
  30. @Test
  31. fun storeFloatNotTheSame() {
  32. val float = 3f
  33. val key = "float"
  34. store.setFloat(key, float)
  35. assertNotSame(float, store.getFloat(key))
  36. }
  37.  
  38. @Test
  39. fun storeIntegerTheSame() {
  40. val int = 3
  41. val key = "int"
  42. store.setInteger(key, int)
  43. assertSame(int, store.getInteger(key))
  44. }
  45.  
  46. @Test
  47. fun storeIntegerNotTheSame() {
  48. val int = 128
  49. val key = "int"
  50. store.setInteger(key, int)
  51. assertNotSame(int, store.getInteger(key))
  52. }
  53.  
  54. @Test
  55. fun storeStringNotTheSame() {
  56. val string = "string"
  57. val key = "string"
  58. store.setString(key, string)
  59. assertNotSame(string, store.getString(key))
  60. }
  61.  
  62. @Test
  63. fun storeStringEquals() {
  64. val string = "string"
  65. val key = "string"
  66. store.setString(key, string)
  67. assertEquals(string, store.getString(key))
  68. }
  69.  
  70. @Test
  71. fun storeBooleanTheSame() {
  72. val boolean = true
  73. val key = "boolean"
  74. store.setBoolean(key, boolean)
  75. assertSame(boolean, store.getBoolean(key))
  76. }
  77.  
  78. @Test
  79. fun storeShortNotTheSame() {
  80. val short: Short = 128
  81. val key = "short"
  82. store.setShort(key, short)
  83. assertNotSame(short, store.getShort(key))
  84. }
  85.  
  86. @Test
  87. fun storeShortEquals() {
  88. val short: Short = 128
  89. val key = "short"
  90. store.setShort(key, short)
  91. assertEquals(short, store.getShort(key))
  92. }
  93.  
  94. @Test
  95. fun storeShortTheSame() {
  96. val short: Short = 3
  97. val key = "short"
  98. store.setShort(key, short)
  99. assertSame(short, store.getShort(key))
  100. }
  101.  
  102. @Test
  103. fun storeByteEquals() {
  104. val byte: Byte = 3
  105. val key = "byte"
  106. store.setByte(key, byte)
  107. assertEquals(byte, store.getByte(key))
  108. }
  109.  
  110. @Test
  111. fun storeByteTheSame() {
  112. val byte: Byte = 3
  113. val key = "byte"
  114. store.setByte(key, byte)
  115. assertSame(byte, store.getByte(key))
  116. }
  117.  
  118. @Test
  119. fun storeDoubleNotTheSame() {
  120. val double: Double = 8.0
  121. val key = "double"
  122. store.setDouble(key, double)
  123. assertNotSame(double, store.getDouble(key))
  124. }
  125.  
  126. @Test
  127. fun storeDoubleEquals() {
  128. val double: Double = 128.0
  129. val key = "double"
  130. store.setDouble(key, double)
  131. assertEquals(double, store.getDouble(key), 0.0)
  132. }
  133.  
  134. @Test
  135. fun storeLongNotTheSame() {
  136. val long: Long = 128
  137. val key = "long"
  138. store.setLong(key, long)
  139. assertNotSame(long, store.getLong(key))
  140. }
  141.  
  142. @Test
  143. fun storeLongEquals() {
  144. val long: Long = 128
  145. val key = "long"
  146. store.setLong(key, long)
  147. assertEquals(long, store.getLong(key))
  148. }
  149.  
  150. @Test
  151. fun storeLongTheSame() {
  152. val long: Long = 3
  153. val key = "long"
  154. store.setLong(key, long)
  155. assertSame(long, store.getLong(key))
  156. }
  157.  
  158. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement