public virtual List<VerificationResult> GetVerificationStatus() { var result = new List<VerificationResult>(); // for each connection in the list foreach (var connection in connectionList) { VerificationResult resultType; var actions = connection.Item2; // if the action list is empty then raise an error if (actions == null || actions.Count == 0) { resultType = new VerificationResult{Message = "The actions specified are invalid", Type = ResultType.Failure}; } else { // else verify the connection resultType = Verify(connection); } // construct the verification result message string message = ConstructMessage(connection, resultType); // aggregate the results result.Add(new VerificationResult {Type = resultType.Type, Message = message}); } return result; }
protected virtual string ConstructMessage(Tuple<string, IDictionary<string, string>> tuple, VerificationResult result) { string itemIdentifier = string.IsNullOrWhiteSpace(tuple.Item1) ? "{Error reading the item's identifier, it may be empty or have the an invalid placeholder}" : tuple.Item1; return result.Type == ResultType.Failure ? string.Format("{0} verifying {1}, Error Message: {2}, {3}", result.Type.ToString(), itemIdentifier, result.Message, ConstructActionMessage(tuple.Item2)) : string.Format("{0} verifying {1}, {2}", result.Type.ToString(), itemIdentifier, ConstructActionMessage(tuple.Item2)); }
protected override string ConstructMessage(Tuple<string, IDictionary<string, string>> tuple, VerificationResult result) { return string.Format("{0}: Could not find a valid verifier for '{1}' with the following elements: {2}", result.Type.ToString(), VerifierName, ConstructActionMessage(tuple.Item2)); }