public async Task CanCancelShiftRelease() { int id = 1; int userId = 2; _shiftRepositoryMock.Setup(x => x.GetScheduledShiftAssignment(id)).Returns(Task.FromResult(new ScheduledShiftAssignment() { Id = 1, AssignedUserId = 1, ClaimedByUserId = userId, OriginalAssignedUserId = 1, ScheduledShiftId = 1, Status = ShiftStatus.Released })).Verifiable(); _shiftRepositoryMock.Setup(x => x.UpdateScheduledShiftAssignment(It.Is <ScheduledShiftAssignment>(y => y.Status == ShiftStatus.Assigned && y.ClaimedByUserId == null && y.AssignedUserId == 1 && y.OriginalAssignedUserId == 1))).Verifiable(); await _scheduleService.CancelShiftRelease(id); _shiftRepositoryMock.Verify(); }