示例#1
0
        public async Task MessageProcessorTest()
        {
            (bool success, Stream content) = await this.cloudProvider.StorageProvider().DownloadFile(Constants.NotifyFilename);

            Assert.That(success, Is.False);
            Assert.That(content, Is.Null);
            string expectedUri = "https://contenturi";

            _ = await this.cloudProvider.QueueProvider().Enqueue(new QueueMetadata()
            {
                Fileuri = expectedUri
            });

            QueueWatcher        watcher = new QueueWatcher(this.cloudProvider, 0);
            NotificationHandler handler = new NotificationHandler(this.cloudProvider);

            MessageProcessor.Run(watcher, handler).Wait();

            (success, content) = await this.cloudProvider.StorageProvider().DownloadFile(Constants.NotifyFilename);

            Assert.That(success, Is.True);
            string stringContent  = this.StreamToString(content);
            var    actualMetadata = JsonConvert.DeserializeObject <QueueMetadata>(stringContent);

            Assert.That(actualMetadata.Fileuri, Is.EqualTo(expectedUri));
        }
示例#2
0
        public void InitPlugin(TabPage pluginScreenSpace, Label pluginStatusText)
        {
            lblStatus = pluginStatusText;
            pluginScreenSpace.Controls.Add(this);
            this.Dock   = DockStyle.Fill;
            xmlSettings = new SettingsSerializer(this);
            LoadSettings();



            lblStatus.Text = "Plugin Started";

            Log.Write(LogType.Info, "Plugin Started");

            notifier = new QueueWatcher();

            notifier.Start();
        }
 public QueueManagerOptions(QueueWatcher[] watchers, string[] pushers)
 {
     Pushers = pushers;
     Watchers = watchers;
 }