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);
        }
示例#2
0
        public async Task InsertShiftRecurringWorkItem(ShiftRecurringWorkItem item)
        {
            int id = (int)await _connection.InsertAsync(item);

            item.Id = id;
        }
示例#3
0
 public Task UpdateShiftRecurringWorkItem(ShiftRecurringWorkItem item)
 {
     return(_connection.UpdateAsync(item));
 }
示例#4
0
 public Task DeleteShiftRecurringWorkItem(ShiftRecurringWorkItem shiftRecurringWorkItem)
 {
     return(_connection.DeleteAsync(shiftRecurringWorkItem));
 }