Skip to content

Commit

Permalink
Remove outdated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
iSoron committed Apr 1, 2019
1 parent 905099c commit c380aba
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 51 deletions.
76 changes: 38 additions & 38 deletions core/src/jvmTest/kotlin/org/isoron/uhabits/backend/BackendTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -48,42 +48,42 @@ class BackendTest : BaseTest() {
dbFile.delete()
}

@Test
fun testMainScreenDataSource() {
val listener = object : MainScreenDataSource.Listener {
override fun onDataChanged(newData: MainScreenDataSource.Data) {
val expected = MainScreenDataSource.Data(
ids = listOf(0, 10, 9, 2, 3, 4, 5, 11, 6, 7, 8),
scores = listOf(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0),
names = listOf("Wake up early", "Eat healthy", "Floss",
"Journal", "Track time", "Meditate",
"Work out", "Take a walk", "Read books",
"Learn French", "Play chess"),
colors = listOf(PaletteColor(8), PaletteColor(8),
PaletteColor(8), PaletteColor(11),
PaletteColor(11), PaletteColor(15),
PaletteColor(15), PaletteColor(15),
PaletteColor(2), PaletteColor(2),
PaletteColor(13)),
checkmarks = listOf(
listOf(2, 0, 0, 0, 0, 2, 0),
listOf(0, 2, 2, 2, 2, 2, 0),
listOf(0, 0, 0, 0, 2, 0, 0),
listOf(0, 2, 0, 2, 0, 0, 0),
listOf(2, 2, 2, 0, 2, 2, 2),
listOf(2, 1, 1, 2, 1, 2, 2),
listOf(2, 0, 2, 0, 2, 1, 2),
listOf(0, 2, 2, 2, 2, 0, 0),
listOf(0, 2, 2, 2, 2, 2, 0),
listOf(0, 0, 2, 0, 2, 0, 2),
listOf(0, 2, 0, 0, 2, 2, 0)))
assertEquals(newData, expected)
latch.countDown()
}
}
backend.mainScreenDataSource.observable.addListener(listener)
backend.mainScreenDataSource.requestData()
assertTrue(latch.await(3, TimeUnit.SECONDS))
}
// @Test
// fun testMainScreenDataSource() {
// val listener = object : MainScreenDataSource.Listener {
// override fun onDataChanged(newData: MainScreenDataSource.Data) {
// val expected = MainScreenDataSource.Data(
// ids = listOf(0, 10, 9, 2, 3, 4, 5, 11, 6, 7, 8),
// scores = listOf(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
// 0.0, 0.0, 0.0),
// names = listOf("Wake up early", "Eat healthy", "Floss",
// "Journal", "Track time", "Meditate",
// "Work out", "Take a walk", "Read books",
// "Learn French", "Play chess"),
// colors = listOf(PaletteColor(8), PaletteColor(8),
// PaletteColor(8), PaletteColor(11),
// PaletteColor(11), PaletteColor(15),
// PaletteColor(15), PaletteColor(15),
// PaletteColor(2), PaletteColor(2),
// PaletteColor(13)),
// checkmarks = listOf(
// listOf(2, 0, 0, 0, 0, 2, 0),
// listOf(0, 2, 2, 2, 2, 2, 0),
// listOf(0, 0, 0, 0, 2, 0, 0),
// listOf(0, 2, 0, 2, 0, 0, 0),
// listOf(2, 2, 2, 0, 2, 2, 2),
// listOf(2, 1, 1, 2, 1, 2, 2),
// listOf(2, 0, 2, 0, 2, 1, 2),
// listOf(0, 2, 2, 2, 2, 0, 0),
// listOf(0, 2, 2, 2, 2, 2, 0),
// listOf(0, 0, 2, 0, 2, 0, 2),
// listOf(0, 2, 0, 0, 2, 2, 0)))
// assertEquals(newData, expected)
// latch.countDown()
// }
// }
// backend.mainScreenDataSource.observable.addListener(listener)
// backend.mainScreenDataSource.requestData()
// assertTrue(latch.await(3, TimeUnit.SECONDS))
// }
}
13 changes: 0 additions & 13 deletions ios/Tests/Platform/IosDatesTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,6 @@ import UIKit

@testable import uhabits

class IosDateTimeTest : XCTestCase {
func testPlusMinusDay() {
let today = LocalDate(year: 2019, month: 3, day: 25)
let calc = IosLocalDateCalculator()
let d1 = calc.minusDays(date: today, days: 28)
let d2 = calc.plusDays(date: today, days: 7)
let d3 = calc.plusDays(date: today, days: 42)
XCTAssert(d1.isEqual(LocalDate(year: 2019, month: 2, day: 25)))
XCTAssert(d2.isEqual(LocalDate(year: 2019, month: 4, day: 1)))
XCTAssert(d3.isEqual(LocalDate(year: 2019, month: 5, day: 6)))
}
}

class IosDateFormatterTest : XCTestCase {
func testShortMonthName() {
let fmt = IosLocalDateFormatter()
Expand Down

0 comments on commit c380aba

Please sign in to comment.