public void TestMethod1()
        {
            const string Message = "hallo trh.net";

            MessageSender.Send(Message);

            var reciever = new MessageReciever();
            var message  = reciever.Recieve();

            message.Should().Be(Message);
        }
        /// <summary>
        /// Settings dialog elements
        /// </summary>
        #region Settings Dialog Elements

        private void Settings_Load(object sender, EventArgs e)
        {
            // Create temporary cancel button
            // for handling escape key press
            Button CloseButton = new Button();

            CloseButton.Click += new EventHandler(this.ButtonClose_Click);

            // Set application settings
            LoadProperties();
            messageReciever = new MessageReciever(new ReminderClient(apiUrl, apiUsername, apiPassword), apiIdentifier);
            AcceptButton    = ButtonSave;
            CancelButton    = CloseButton;
            ShowInTaskbar   = false;
            TopMost         = true;

            // Set window location
            ShowSettings();

            // Create tray menu
            trayMenu = new ContextMenu();
            trayMenu.MenuItems.Add("Search for reminders", MenuSearchReminders);
            trayMenu.MenuItems.Add("-");
            trayMenu.MenuItems.Add("Dismiss all reminders", MenuDismissAllMessages);
            trayMenu.MenuItems.Add("Reschedule all reminders", MenuRescheduleAllMessages);
            trayMenu.MenuItems.Add("-");
            trayMenu.MenuItems.Add("Open Settings", MenuOpenSettings);
            trayMenu.MenuItems.Add("-");
            trayMenu.MenuItems.Add("Close Application", MenuExit);
            TrayIcon.ContextMenu      = trayMenu;
            MessageHandler.NotifyIcon = TrayIcon;

            // Start timer
            TimerRecive.Start();

            // Hide application when api is usable
            // and search for messages
            if (apiIdentifier != String.Empty)
            {
                Visible = false;
                DismissEnabled(true);
                messageReciever.Recieve();
            }
            else
            {
                DismissEnabled(false);
            }
        }
 private void MenuSearchReminders(object sender, EventArgs e)
 {
     messageReciever.Recieve();
 }