如何使用 .net 客户端将文件/图片发送到 Report Portal?

How can I send files / pictures to Report Portal with .net client?

我想向 Report Portal with .net client 发送一个二进制附件。我该怎么做?

示例在测试项目中。

https://github.com/reportportal/client-net/blob/master/ReportPortal.Client.Tests/LogItem/LogItem.cs

查找 CreateLogWithAttach 测试并查看代码。

var data = new byte[] { 1, 2, 3 };
            var log = Service.AddLogItem(new AddLogItemRequest
            {
                TestItemId = _testId,
                Text = "Log1",
                Time = DateTime.UtcNow,
                Level = LogLevel.Info,
                Attach = new Attach("file1", "application/octet-stream", data)
            });

相关文档:Log Data in ReportPortal