mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 01:08:50 -06:00
Remove outdated tests
This commit is contained in:
@@ -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))
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user