public void SendFileAsyncShouldInvokeSendFileCompletedIfRegistered()
        {
            var filename = Path.Combine(AppContext.BaseDirectory, "filename.txt");

            File.WriteAllText(filename, string.Empty);

            var guid      = Guid.NewGuid();
            var sessionId = new SessionId(guid);
            var context   = new DataCollectionContext(sessionId);

            var fileTransferInfo = new FileTransferInformation(context, filename, false);

            var attachmentManager = new DataCollectionAttachmentManager();

            attachmentManager.Initialize(sessionId, AppContext.BaseDirectory, new Mock <IMessageSink>().Object);

            this.dataCollectionSink = new TestPlatformDataCollectionSink(attachmentManager, this.dataCollectorConfig);
            this.dataCollectionSink.SendFileCompleted += SendFileCompleted_Handler;
            this.dataCollectionSink.SendFileAsync(fileTransferInfo);

            var result = attachmentManager.GetAttachments(context);

            Assert.IsNotNull(result);
            Assert.IsTrue(this.isEventHandlerInvoked);
        }
 public TestPlatformDataCollectionSinkTests()
 {
     this.attachmentManager     = new Mock <IDataCollectionAttachmentManager>();
     this.dataCollectorConfig   = new DataCollectorConfig(typeof(CustomDataCollector));
     this.dataCollectionSink    = new TestPlatformDataCollectionSink(this.attachmentManager.Object, this.dataCollectorConfig);
     this.isEventHandlerInvoked = false;
 }