Method AddAttachment
- Namespace
- Xunit
- Assembly
- xunit.v3.core.dll
AddAttachment(string, string)
Adds an attachment that is a string value.
void AddAttachment(string name, string value)
Parameters
AddAttachment(string, byte[], string)
Adds an attachment that is a binary value (represented by a byte array and media type).
void AddAttachment(string name, byte[] value, string mediaType = "application/octet-stream")
Parameters
namestringThe name of the attachment
valuebyte[]The value of the attachment
mediaTypestringThe media type of the attachment; defaults to "application/octet-stream"
Remarks
The mediaType value must be in the MIME "type/subtype" form, and does not support
parameter values. The subtype is allowed to have a single "+" to denote specialization of the
subtype (i.e., "application/xhtml+xml"). For more information on media types, see
https://datatracker.ietf.org/doc/html/rfc2045#section-5.1.