コード例 #1
0
        /// <inheritdoc />
        public override Attachment Normalize()
        {
            string normalizedName        = MarkupNormalizationUtils.NormalizeAttachmentName(Name);
            string normalizedContentType = MarkupNormalizationUtils.NormalizeContentType(ContentType);

            if (ReferenceEquals(Name, normalizedName) &&
                ReferenceEquals(ContentType, normalizedContentType))
            {
                return(this);
            }

            return(new BinaryAttachment(normalizedName, normalizedContentType, bytes));
        }
コード例 #2
0
ファイル: TextAttachment.cs プロジェクト: soelske/mbunit-v3
        /// <inheritdoc />
        public override Attachment Normalize()
        {
            string normalizedName        = MarkupNormalizationUtils.NormalizeAttachmentName(Name);
            string normalizedContentType = MarkupNormalizationUtils.NormalizeContentType(ContentType);
            string normalizedText        = MarkupNormalizationUtils.NormalizeText(text);

            if (ReferenceEquals(Name, normalizedName) &&
                ReferenceEquals(ContentType, normalizedContentType) &&
                ReferenceEquals(text, normalizedText))
            {
                return(this);
            }

            return(new TextAttachment(normalizedName, normalizedContentType, text));
        }