Changeset View
Changeset View
Standalone View
Standalone View
tests/units/domain/tasktest.cpp
Show First 20 Lines • Show All 176 Lines • ▼ Show 20 Line(s) | 44 | private slots: | |||
---|---|---|---|---|---|
177 | } | 177 | } | ||
178 | 178 | | |||
179 | void shouldNotifyStartDateChanges() | 179 | void shouldNotifyStartDateChanges() | ||
180 | { | 180 | { | ||
181 | Task t; | 181 | Task t; | ||
182 | QSignalSpy spy(&t, &Task::startDateChanged); | 182 | QSignalSpy spy(&t, &Task::startDateChanged); | ||
183 | t.setStartDate(QDate(2014, 1, 13)); | 183 | t.setStartDate(QDate(2014, 1, 13)); | ||
184 | QCOMPARE(spy.count(), 1); | 184 | QCOMPARE(spy.count(), 1); | ||
185 | QCOMPARE(spy.first().first().toDateTime(), QDateTime(QDate(2014, 1, 13))); | 185 | QCOMPARE(spy.first().first().toDate(), QDate(2014, 1, 13)); | ||
186 | } | 186 | } | ||
187 | 187 | | |||
188 | void shouldNotNotifyIdenticalStartDateChanges() | 188 | void shouldNotNotifyIdenticalStartDateChanges() | ||
189 | { | 189 | { | ||
190 | Task t; | 190 | Task t; | ||
191 | t.setStartDate(QDate(2014, 1, 13)); | 191 | t.setStartDate(QDate(2014, 1, 13)); | ||
192 | QSignalSpy spy(&t, &Task::startDateChanged); | 192 | QSignalSpy spy(&t, &Task::startDateChanged); | ||
193 | t.setStartDate(QDate(2014, 1, 13)); | 193 | t.setStartDate(QDate(2014, 1, 13)); | ||
194 | QCOMPARE(spy.count(), 0); | 194 | QCOMPARE(spy.count(), 0); | ||
195 | } | 195 | } | ||
196 | 196 | | |||
197 | void shouldNotifyDueDateChanges() | 197 | void shouldNotifyDueDateChanges() | ||
198 | { | 198 | { | ||
199 | Task t; | 199 | Task t; | ||
200 | QSignalSpy spy(&t, &Task::dueDateChanged); | 200 | QSignalSpy spy(&t, &Task::dueDateChanged); | ||
201 | t.setDueDate(QDate(2014, 1, 13)); | 201 | t.setDueDate(QDate(2014, 1, 13)); | ||
202 | QCOMPARE(spy.count(), 1); | 202 | QCOMPARE(spy.count(), 1); | ||
203 | QCOMPARE(spy.first().first().toDateTime(), QDateTime(QDate(2014, 1, 13))); | 203 | QCOMPARE(spy.first().first().toDate(), QDate(2014, 1, 13)); | ||
204 | } | 204 | } | ||
205 | 205 | | |||
206 | void shouldNotNotifyIdenticalDueDateChanges() | 206 | void shouldNotNotifyIdenticalDueDateChanges() | ||
207 | { | 207 | { | ||
208 | Task t; | 208 | Task t; | ||
209 | t.setDueDate(QDate(2014, 1, 13)); | 209 | t.setDueDate(QDate(2014, 1, 13)); | ||
210 | QSignalSpy spy(&t, &Task::dueDateChanged); | 210 | QSignalSpy spy(&t, &Task::dueDateChanged); | ||
211 | t.setDueDate(QDate(2014, 1, 13)); | 211 | t.setDueDate(QDate(2014, 1, 13)); | ||
▲ Show 20 Lines • Show All 108 Lines • Show Last 20 Lines |