public void Validate_checks_pollToken_valid()
        {
            // Assemble
            var token = _PollTokenService.Next();
            var args  = new LabVerifyArgs {
                PollToken = token
            };
            // Act
            var result = _Validator.Validate(args);

            // Assert
            Assert.True(result);
        }
        private bool WriteAttempt(TekReleaseWorkflowStateEntity wf)
        {
            if (++_AttemptCount > AttemptCountMax)
            {
                throw new InvalidOperationException("Maximum attempts reached.");
            }

            if (_AttemptCount > 1)
            {
                _Logger.LogWarning("Duplicate PollToken found - attempt:{AttemptCount}", _AttemptCount);
            }

            wf.PollToken = _PollTokenService.Next();

            try
            {
                _WorkflowDb.SaveAndCommit();
                _Logger.LogDebug("Committed.");
                return(true);
            }
            catch (DbUpdateException ex)
            {
                if (CanRetry(ex))
                {
                    return(false);
                }

                throw;
            }
        }
        private bool WriteAttempt(TekReleaseWorkflowStateEntity wf)
        {
            if (++_attemptCount > AttemptCountMax)
            {
                throw new InvalidOperationException("Maximum attempts reached.");
            }

            if (_attemptCount > 1)
            {
                _logger.WriteDuplicatePollTokenFound(_attemptCount);
            }

            wf.PollToken = _pollTokenService.Next();

            try
            {
                _workflowDb.SaveAndCommit();
                _logger.WritePollTokenCommit();
                return(true);
            }
            catch (DbUpdateException ex)
            {
                if (CanRetry(ex))
                {
                    return(false);
                }

                throw;
            }
        }