Esempio n. 1
0
        public void DoesNotFiresNewBuildAvailableOnSameStatusAfterLoadError()
        {
            AddFakeProjectStatus("a", "PASS", "2006-12-31 12:00:00");

            monitor.Reload();

            newBuildEventArgs = null;

            monitor.Exception = new WebException();
            monitor.Reload();

            monitor.Exception = null;
            monitor.Reload();

            Assert.IsNull(newBuildEventArgs, "Should not fire NewBuildAvailable when timestamp does not change.");
        }
Esempio n. 2
0
        public void SetUp()
        {
            monitor = new StatusMonitorStub();
            monitor.DataLoadError += monitor_DataLoadError;
            monitor.DataLoaded += monitor_DataLoaded;
            monitor.DashboardStatusChanged += monitor_DashboardStatusChanged;
            monitor.NewBuildAvailable += monitor_NewBuildAvailable;
            fakeStatus = new XmlDocument();

            projectNodes = fakeStatus.CreateElement("projects");

            fakeStatus.AppendChild(projectNodes);

            monitor.Document = fakeStatus;

            errorEventArgs = null;
            loadEventArgs = null;
            statusChangedEventArgs = null;
            newBuildEventArgs = null;
        }
Esempio n. 3
0
 void monitor_NewBuildAvailable(object source, NewBuildEventArgs e)
 {
     newBuildEventArgs = e;
 }
Esempio n. 4
0
        private void onNewBuild(object source, NewBuildEventArgs e)
        {
            latestProject = e.ProjectNode;

            string projectName = latestProject.Attributes["name"].Value;
            string status = latestProject.SelectSingleNode("status").InnerText;
            string message = latestProject.SelectSingleNode("message").InnerText;

            bool isPass = "******".Equals(status);

            bool shouldBubble = (isPass && statusForm.Preferences.BubbleSuccess)
                || (!isPass && statusForm.Preferences.BubbleFailures);

            if (!shouldBubble)
            {
                return;
            }

            string title = string.Format(
                "{0}: {1}",
                projectName,
                status);

            string text = string.Format(
                "{0}",
                message);

            ToolTipIcon icon = ToolTipIcon.Error;

            if (isPass)
            {
                icon = ToolTipIcon.Info;
            }

            displayBubble(title, text, icon);
        }