public async Task CanRetrieveInsertedShiftRecurringWorkItem() { var recurringWorkItem = new RecurringWorkItem() { PatrolId = 1, CreatedAt = DateTime.Now, CreatedByUserId = 1, Name = "Name", Location = "Location", CompletionMode = CompletionMode.Any, DescriptionMarkup = "Markup", AdminGroupId = 1 }; await _workItemRepository.InsertRecurringWorkItem(recurringWorkItem); var shiftRecurringWorkItem = new ShiftRecurringWorkItem() { RecurringWorkItemId = recurringWorkItem.Id, ShiftId = 1, ScheduledAtHour = 9, ScheduledAtMinute = 0 }; await _workItemRepository.InsertShiftRecurringWorkItem(shiftRecurringWorkItem); var inserted = await _workItemRepository.GetShiftRecurringWorkItem(shiftRecurringWorkItem.Id); Assert.AreEqual(shiftRecurringWorkItem.RecurringWorkItemId, inserted.RecurringWorkItemId); Assert.AreEqual(shiftRecurringWorkItem.ShiftId, inserted.ShiftId); Assert.AreEqual(shiftRecurringWorkItem.ScheduledAtHour, inserted.ScheduledAtHour); Assert.AreEqual(shiftRecurringWorkItem.ScheduledAtMinute, inserted.ScheduledAtMinute); }
public async Task InsertShiftRecurringWorkItem(ShiftRecurringWorkItem item) { int id = (int)await _connection.InsertAsync(item); item.Id = id; }
public Task UpdateShiftRecurringWorkItem(ShiftRecurringWorkItem item) { return(_connection.UpdateAsync(item)); }
public Task DeleteShiftRecurringWorkItem(ShiftRecurringWorkItem shiftRecurringWorkItem) { return(_connection.DeleteAsync(shiftRecurringWorkItem)); }