コード例 #1
0
        /// <inheritdoc />
        public CodeLocation Normalize()
        {
            string normalizedPath = NormalizationUtils.NormalizeName(path);

            if (ReferenceEquals(path, normalizedPath))
            {
                return(this);
            }

            return(new CodeLocation(normalizedPath, line, column));
        }
コード例 #2
0
ファイル: CodeReference.cs プロジェクト: soelske/mbunit-v3
        /// <inheritdoc />
        public CodeReference Normalize()
        {
            string normalizedAssemblyName  = NormalizationUtils.NormalizeName(assemblyName);
            string normalizedNamespaceName = NormalizationUtils.NormalizeName(namespaceName);
            string normalizedTypeName      = NormalizationUtils.NormalizeName(typeName);
            string normalizedMemberName    = NormalizationUtils.NormalizeName(memberName);
            string normalizedParameterName = NormalizationUtils.NormalizeName(parameterName);

            if (ReferenceEquals(assemblyName, normalizedAssemblyName) &&
                ReferenceEquals(namespaceName, normalizedNamespaceName) &&
                ReferenceEquals(typeName, normalizedTypeName) &&
                ReferenceEquals(memberName, normalizedMemberName) &&
                ReferenceEquals(parameterName, normalizedParameterName))
            {
                return(this);
            }

            return(new CodeReference(normalizedAssemblyName, normalizedNamespaceName,
                                     normalizedTypeName, normalizedMemberName, normalizedParameterName));
        }
コード例 #3
0
        /// <inheritdoc />
        public ExceptionData Normalize()
        {
            string         normalizedType       = NormalizationUtils.NormalizeName(type);
            string         normalizedMessage    = NormalizationUtils.NormalizeXmlText(message);
            StackTraceData normalizedStackTrace = stackTrace.Normalize();
            PropertySet    normalizedProperties = NormalizationUtils.NormalizeCollection <PropertySet, KeyValuePair <string, string> >(properties,
                                                                                                                                       () => new PropertySet(),
                                                                                                                                       x => new KeyValuePair <string, string>(NormalizationUtils.NormalizeName(x.Key),
                                                                                                                                                                              NormalizationUtils.NormalizeXmlText(x.Value)),
                                                                                                                                       (x, y) => x.Key == y.Key && x.Value == y.Value);
            ExceptionData normalizedInnerException = innerException != null?innerException.Normalize() : null;

            if (ReferenceEquals(type, normalizedType) &&
                ReferenceEquals(message, normalizedMessage) &&
                ReferenceEquals(stackTrace, normalizedStackTrace) &&
                ReferenceEquals(properties, normalizedProperties) &&
                ReferenceEquals(innerException, normalizedInnerException))
            {
                return(this);
            }

            return(new ExceptionData(normalizedType, normalizedMessage, normalizedStackTrace, normalizedProperties, normalizedInnerException));
        }
コード例 #4
0
 /// <summary>
 /// Normalizes a section name.
 /// </summary>
 /// <param name="sectionName">The section name, or null if none.</param>
 /// <returns>The normalized section name, or null if none.  May be the same instance if <paramref name="sectionName"/>
 /// was already normalized.</returns>
 public static string NormalizeSectionName(string sectionName)
 {
     return(NormalizationUtils.NormalizeName(sectionName));
 }
コード例 #5
0
 /// <summary>
 /// Normalizes a stream name.
 /// </summary>
 /// <param name="streamName">The stream name, or null if none.</param>
 /// <returns>The normalized stream name, or null if none.  May be the same instance if <paramref name="streamName"/>
 /// was already normalized.</returns>
 public static string NormalizeStreamName(string streamName)
 {
     return(NormalizationUtils.NormalizeName(streamName));
 }
コード例 #6
0
 /// <summary>
 /// Normalizes an attachment name.
 /// </summary>
 /// <param name="attachmentName">The attachment name, or null if none.</param>
 /// <returns>The normalized attachment name, or null if none.  May be the same instance if <paramref name="attachmentName"/>
 /// was already normalized.</returns>
 public static string NormalizeAttachmentName(string attachmentName)
 {
     return(NormalizationUtils.NormalizeName(attachmentName));
 }
コード例 #7
0
 /// <summary>
 /// Normalizes a metadata key.
 /// </summary>
 /// <param name="metadataKey">The metadata key, or null if none.</param>
 /// <returns>The normalized metadata key, or null if none.  May be the same instance if <paramref name="metadataKey"/>
 /// was already normalized.</returns>
 public static string NormalizeMetadataKey(string metadataKey)
 {
     return(NormalizationUtils.NormalizeName(metadataKey));
 }
コード例 #8
0
 /// <summary>
 /// Normalizes a lifecycle phase.
 /// </summary>
 /// <param name="lifecyclePhase">The lifecycle phase, or null if none.</param>
 /// <returns>The normalized lifecycle phase, or null if none.  May be the same instance if <paramref name="lifecyclePhase"/>
 /// was already normalized.</returns>
 public static string NormalizeLifecyclePhase(string lifecyclePhase)
 {
     return(NormalizationUtils.NormalizeName(lifecyclePhase));
 }
コード例 #9
0
 /// <summary>
 /// Normalizes a test, step or parameter name.
 /// </summary>
 /// <param name="name">The name, or null if none.</param>
 /// <returns>The normalized name, or null if none.  May be the same instance if <paramref name="name"/>
 /// was already normalized.</returns>
 public static string NormalizeTestComponentName(string name)
 {
     return(NormalizationUtils.NormalizeName(name));
 }