Skip to content
Snippets Groups Projects
Commit ed709b1c authored by Klaus Fischer's avatar Klaus Fischer
Browse files

Resolved warnings, removed InputStreams for Submissions from public interface

parent ee418248
No related branches found
No related tags found
2 merge requests!28773 direct submission status,!27Draft: Issue/830 http header add version
......@@ -13,6 +13,10 @@ public static class SenderDemo {
var destinationId = config["FitConnect:Sender:DestinationId"];
var leikaKey = config["FitConnect:Sender:LeikaKey"];
if (clientId == null || clientSecret == null || destinationId == null || leikaKey == null) {
logger.LogError("Missing configuration values");
return;
}
OutputHelper.PrintSender();
......@@ -34,6 +38,11 @@ public static class SenderDemo {
var destinationId = config["FitConnect:Sender:DestinationId"];
var leikaKey = config["FitConnect:Sender:LeikaKey"];
if (clientId == null || clientSecret == null || destinationId == null || leikaKey == null) {
logger.LogError("Missing configuration values");
return;
}
var encryption = new FitEncryption("", "", null);
Dictionary<string, string>? encryptedAttachments = null;
......
......@@ -11,6 +11,10 @@ public static class SubscriberDemo {
var privateKeyDecryption = config["FitConnect:Subscriber:PrivateKeyDecryption"];
var privateKeySigning = config["FitConnect:Subscriber:PrivateKeySigning"];
if (clientId == null || clientSecret == null || privateKeyDecryption == null || privateKeySigning == null) {
logger.LogError("Missing configuration values");
return;
}
OutputHelper.PrintSubscriber();
......
......@@ -21,9 +21,9 @@ public class StraightForwardTest : EndToEndTestBase {
.WithAttachments(new Attachment("Test.pdf", "Attachment #1"),
new Attachment("Test.pdf", "Attachment #2"))
.WithAttachments(new Attachment("Test.pdf", "Attachment #3"))
.WithAttachments("Test.pdf", "Attachment #4 - StreamReader",
System.Net.Mime.MediaTypeNames.Application.Pdf,
new FileStream("Test.pdf", FileMode.Open, FileAccess.Read))
// .WithAttachments("Test.pdf", "Attachment #4 - StreamReader",
// System.Net.Mime.MediaTypeNames.Application.Pdf,
// new FileStream("Test.pdf", FileMode.Open, FileAccess.Read))
.Build();
var submission = Sender.SendAsync(outgoing).Result;
......@@ -90,7 +90,7 @@ public class StraightForwardTest : EndToEndTestBase {
attachments.TrueForAll(a => a.Filename == "Test.pdf");
attachments.TrueForAll(a => a.Description?.StartsWith("Attachment #") ?? false).Should()
.BeTrue();
attachments.Count.Should().Be(4);
attachments.Count.Should().Be(3);
var size = File.ReadAllBytes("Test.pdf").Length;
attachments.ForEach(a => a.Content!.Length.Should().Be(size));
subscriberWithSubmission.AcceptSubmissionAsync().Wait();
......
......@@ -19,7 +19,7 @@ public class SubmissionBuilder : ISubmissionWithDestination,
return WithAttachments(attachments.ToArray());
}
public ISubmissionWithData WithAttachments(string fileName, string description, string mimeType,
private ISubmissionWithData WithAttachments(string fileName, string description, string mimeType,
FileStream fileStream) {
byte[]? buffer;
using (fileStream) {
......@@ -108,8 +108,12 @@ public interface ISubmissionWithData {
ISubmissionWithData WithAttachments(params Attachment[] attachments);
ISubmissionWithData WithAttachments(List<Attachment> attachments);
ISubmissionWithData WithAttachments(string fileName, string description, string mimeType,
FileStream content);
/// <summary>
/// For future use
/// </summary>
/// <returns></returns>
// ISubmissionWithData WithAttachments(string fileName, string description, string mimeType,
// FileStream content);
SendableSubmission Build();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment