File tree 3 files changed +4
-31
lines changed
Todoist.Net.Tests/Services
3 files changed +4
-31
lines changed Original file line number Diff line number Diff line change @@ -29,20 +29,18 @@ public async Task CreateDelete_Success()
29
29
var transaction = client . CreateTransaction ( ) ;
30
30
31
31
var itemId = await transaction . Items . AddAsync ( new AddItem ( "Temp" ) ) ;
32
- var reminderId =
33
- await transaction . Reminders . AddAsync ( new Reminder ( itemId ) { DueDate = DueDate . CreateFloating ( DateTime . UtcNow . AddDays ( 1 ) ) } ) ;
32
+ var reminder = new Reminder ( itemId ) { DueDate = DueDate . CreateFloating ( DateTime . UtcNow . AddDays ( 1 ) ) } ;
33
+ await transaction . Reminders . AddAsync ( reminder ) ;
34
34
await transaction . CommitAsync ( ) ;
35
35
try
36
36
{
37
37
var reminders = await client . Reminders . GetAsync ( ) ;
38
- Assert . True ( reminders . Any ( ) ) ;
39
38
40
- var reminderInfo = await client . Reminders . GetAsync ( reminderId ) ;
41
- Assert . NotNull ( reminderInfo ) ;
39
+ Assert . Contains ( reminders , r => r . Id == reminder . Id ) ;
42
40
}
43
41
finally
44
42
{
45
- await client . Reminders . DeleteAsync ( reminderId ) ;
43
+ await client . Reminders . DeleteAsync ( reminder . Id ) ;
46
44
await client . Items . DeleteAsync ( itemId ) ;
47
45
}
48
46
}
Original file line number Diff line number Diff line change @@ -19,16 +19,5 @@ public interface IRemindersService : IRemindersCommandService
19
19
/// <returns>The filters.</returns>
20
20
/// <exception cref="HttpRequestException">API exception.</exception>
21
21
Task < IEnumerable < Reminder > > GetAsync ( CancellationToken cancellationToken = default ) ;
22
-
23
- /// <summary>
24
- /// Gets a reminder info by ID.
25
- /// </summary>
26
- /// <param name="id">The ID of the reminder.</param>
27
- /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
28
- /// <returns>
29
- /// The reminder info.
30
- /// </returns>
31
- /// <exception cref="HttpRequestException">API exception.</exception>
32
- Task < ReminderInfo > GetAsync ( ComplexId id , CancellationToken cancellationToken = default ) ;
33
22
}
34
23
}
Original file line number Diff line number Diff line change @@ -23,19 +23,5 @@ public async Task<IEnumerable<Reminder>> GetAsync(CancellationToken cancellation
23
23
24
24
return response . Reminders ;
25
25
}
26
-
27
- /// <inheritdoc/>
28
- public Task < ReminderInfo > GetAsync ( ComplexId id , CancellationToken cancellationToken = default )
29
- {
30
- return TodoistClient . PostAsync < ReminderInfo > (
31
- "reminders/get" ,
32
- new List < KeyValuePair < string , string > >
33
- {
34
- new KeyValuePair < string , string > (
35
- "reminder_id" ,
36
- id . ToString ( ) )
37
- } ,
38
- cancellationToken ) ;
39
- }
40
26
}
41
27
}
You can’t perform that action at this time.
0 commit comments