From c380abad5a223d45cd635a62ea486dfa0247bd68 Mon Sep 17 00:00:00 2001 From: Alinson Xavier Date: Mon, 1 Apr 2019 07:35:18 -0500 Subject: [PATCH] Remove outdated tests --- .../org/isoron/uhabits/backend/BackendTest.kt | 76 +++++++++---------- ios/Tests/Platform/IosDatesTest.swift | 13 ---- 2 files changed, 38 insertions(+), 51 deletions(-) diff --git a/core/src/jvmTest/kotlin/org/isoron/uhabits/backend/BackendTest.kt b/core/src/jvmTest/kotlin/org/isoron/uhabits/backend/BackendTest.kt index 85d16cc3f..6087423b0 100644 --- a/core/src/jvmTest/kotlin/org/isoron/uhabits/backend/BackendTest.kt +++ b/core/src/jvmTest/kotlin/org/isoron/uhabits/backend/BackendTest.kt @@ -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)) +// } } diff --git a/ios/Tests/Platform/IosDatesTest.swift b/ios/Tests/Platform/IosDatesTest.swift index fab1ad35e..c3867439a 100644 --- a/ios/Tests/Platform/IosDatesTest.swift +++ b/ios/Tests/Platform/IosDatesTest.swift @@ -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()