private static RedisTaskRuntimeInfo Convert(IReadOnlyDictionary <string, string> values)
        {
            if (values == null)
            {
                throw new ArgumentNullException("values");
            }

            RedisTaskRuntimeInfo result = new RedisTaskRuntimeInfo(
                RedisConverter.ParseGuid(values["Id"]),
                RedisConverter.ParseType(values["TaskType"]),
                RedisConverter.ParseDateTime(values["SubmittedUtc"]),
                RedisConverter.ParseEnum <TaskStatus>(values["Status"]));

            string value;

            if (values.TryGetValue("PollingQueue", out value))
            {
                result.PollingQueue = value;
            }

            if (values.TryGetValue("Priority", out value))
            {
                result.Priority = RedisConverter.ParseEnum <TaskPriority>(value);
            }

            if (values.TryGetValue("TaskProcessorId", out value))
            {
                result.TaskProcessorId = RedisConverter.ParseGuidOrNull(value);
            }

            if (values.TryGetValue("StartedUtc", out value))
            {
                result.StartedUtc = RedisConverter.ParseDateTimeOrNull(value);
            }

            if (values.TryGetValue("Percentage", out value))
            {
                result.Percentage = RedisConverter.ParseDouble(value);
            }

            if (values.TryGetValue("CanceledUtc", out value))
            {
                result.CanceledUtc = RedisConverter.ParseDateTimeOrNull(value);
            }

            if (values.TryGetValue("CompletedUtc", out value))
            {
                result.CompletedUtc = RedisConverter.ParseDateTimeOrNull(value);
            }

            if (values.TryGetValue("Error", out value))
            {
                result.Error = value;
            }

            return(result);
        }
 public void ParseGuidOrNullValue()
 {
     Assert.AreEqual(Guid.Empty, RedisConverter.ParseGuidOrNull(RedisConverter.ToString(Guid.Empty)));
 }