當前位置: 首頁>>代碼示例>>C#>>正文


C# RulesEngineWrapper.InvokeStatusChecked方法代碼示例

本文整理匯總了C#中SirenOfShame.Test.Unit.Watcher.RulesEngineWrapper.InvokeStatusChecked方法的典型用法代碼示例。如果您正苦於以下問題:C# RulesEngineWrapper.InvokeStatusChecked方法的具體用法?C# RulesEngineWrapper.InvokeStatusChecked怎麽用?C# RulesEngineWrapper.InvokeStatusChecked使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在SirenOfShame.Test.Unit.Watcher.RulesEngineWrapper的用法示例。


在下文中一共展示了RulesEngineWrapper.InvokeStatusChecked方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: BuildStatusChanged_InProgressBuilds_DoSync

 public void BuildStatusChanged_InProgressBuilds_DoSync()
 {
     var rulesEngine = new RulesEngineWrapper();
     rulesEngine.Settings.SosOnlineAlwaysSync = true;
     rulesEngine.Settings.SosOnlineWhatToSync = WhatToSyncEnum.BuildStatuses;
     rulesEngine.Settings.SosOnlineUsername = "mockUsername";
     var mock = new Mock<SosOnlineService>();
     rulesEngine.SosOnlineService = mock.Object;
     rulesEngine.InvokeStatusChecked(BuildStatusEnum.Working);
     rulesEngine.InvokeStatusChecked(BuildStatusEnum.InProgress);
     mock.Verify(i => i.BuildStatusChanged(It.IsAny<SirenOfShameSettings>(), It.IsAny<IList<BuildStatus>>(), It.IsAny<List<InstanceUserDto>>()), Times.Exactly(2));
 }
開發者ID:BubbaFatAss,項目名稱:SirenOfShame,代碼行數:12,代碼來源:SosOnlineServiceTest.cs

示例2: Synchronize_ICheckInWithAlwaysSyncSetting_SosOnlineServiceSynchronize

        public void Synchronize_ICheckInWithAlwaysSyncSetting_SosOnlineServiceSynchronize()
        {
            var rulesEngine = new RulesEngineWrapper();
            rulesEngine.Settings.SosOnlineAlwaysSync = true;
            rulesEngine.Settings.SosOnlineUsername = "mockUsername";
            rulesEngine.Settings.MyRawName = RulesEngineWrapper.CURRENT_USER;

            var sosOnlineService = new Mock<SosOnlineService>();
            sosOnlineService.Setup(i => i.Synchronize(It.IsAny<SirenOfShameSettings>(), "633979044610000000,633979050100000000,1", null, It.IsAny<Action<DateTime>>(), It.IsAny<Action<String, ServerUnavailableException>>()))
                .Verifiable();
            rulesEngine.SosOnlineService = sosOnlineService.Object;

            rulesEngine.InvokeStatusChecked(BuildStatusEnum.Working);
            rulesEngine.InvokeStatusChecked(BuildStatusEnum.InProgress);
            rulesEngine.InvokeStatusChecked(BuildStatusEnum.Working);

            sosOnlineService.Verify();
        }
開發者ID:BubbaFatAss,項目名稱:SirenOfShame,代碼行數:18,代碼來源:SosOnlineServiceTest.cs

示例3: BuildStatusChanged_MyPointAndAchievementsOnly_DoesNotSync

 public void BuildStatusChanged_MyPointAndAchievementsOnly_DoesNotSync()
 {
     var rulesEngine = new RulesEngineWrapper();
     rulesEngine.Settings.SosOnlineAlwaysSync = true;
     rulesEngine.Settings.SosOnlineWhatToSync = WhatToSyncEnum.MyPointAndAchievementsOnly;
     rulesEngine.Settings.SosOnlineUsername = "mockUsername";
     var mock = new Mock<SosOnlineService>();
     rulesEngine.SosOnlineService = mock.Object;
     rulesEngine.InvokeStatusChecked(BuildStatusEnum.Working);
     mock.Verify(i => i.BuildStatusChanged(It.IsAny<SirenOfShameSettings>(), It.IsAny<IList<BuildStatus>>(), It.IsAny<List<InstanceUserDto>>()), Times.Never());
 }
開發者ID:BubbaFatAss,項目名稱:SirenOfShame,代碼行數:11,代碼來源:SosOnlineServiceTest.cs

示例4: BreakThenFixesBuild_UserHasStatsUpdated

        public void BreakThenFixesBuild_UserHasStatsUpdated()
        {
            var rulesEngine = new RulesEngineWrapper();

            rulesEngine.InvokeStatusChecked(BuildStatusEnum.Broken); // it should ignore initial states
            rulesEngine.InvokeStatusChecked(BuildStatusEnum.InProgress);
            rulesEngine.InvokeStatusChecked(BuildStatusEnum.Broken);

            Assert.AreEqual(1, rulesEngine.Settings.People.Count);
            Assert.AreEqual(1, rulesEngine.Settings.People[0].TotalBuilds);
            Assert.AreEqual(1, rulesEngine.Settings.People[0].FailedBuilds);

            rulesEngine.InvokeStatusChecked(BuildStatusEnum.InProgress);

            Assert.AreEqual(1, rulesEngine.Settings.People[0].TotalBuilds);
            Assert.AreEqual(1, rulesEngine.Settings.People[0].FailedBuilds);

            rulesEngine.InvokeStatusChecked(BuildStatusEnum.Working);

            Assert.AreEqual(2, rulesEngine.Settings.People[0].TotalBuilds);
            Assert.AreEqual(1, rulesEngine.Settings.People[0].FailedBuilds);
        }
開發者ID:mightymuke,項目名稱:SirenOfShame,代碼行數:22,代碼來源:RulesEngineTest.cs

示例5: BuidFailsForMyBuild_OneAlert

        public void BuidFailsForMyBuild_OneAlert()
        {
            var rulesEngine = new RulesEngineWrapper();

            rulesEngine.Rules.Add(new Rule
            {
                TriggerType = TriggerType.BuildFailed,
                AlertType = AlertType.ModalDialog,
                BuildDefinitionId = RulesEngineWrapper.BUILD1_ID
            });

            rulesEngine.InvokeStatusChecked(BuildStatusEnum.Broken);
            Assert.AreEqual(1, rulesEngine.ModalDialogEvents.Count);
        }
開發者ID:mightymuke,項目名稱:SirenOfShame,代碼行數:14,代碼來源:RulesEngineTest.cs

示例6: BuidFailsForSomeOtherBuild_NoAlert

        public void BuidFailsForSomeOtherBuild_NoAlert()
        {
            var rulesEngine = new RulesEngineWrapper();

            rulesEngine.Rules.Add(new Rule
            {
                TriggerType = TriggerType.BuildFailed,
                AlertType = AlertType.ModalDialog,
                BuildDefinitionId = "SomeOtherBuild"
            });

            rulesEngine.InvokeStatusChecked(BuildStatusEnum.Broken);
            Assert.AreEqual(0, rulesEngine.ModalDialogEvents.Count);
        }
開發者ID:mightymuke,項目名稱:SirenOfShame,代碼行數:14,代碼來源:RulesEngineTest.cs

示例7: InProgressDoesNotWrite

        public void InProgressDoesNotWrite()
        {
            var rulesEngine = new RulesEngineWrapper();

            rulesEngine.InvokeStatusChecked(BuildStatusEnum.Working); // do not write initial states
            rulesEngine.InvokeStatusChecked(BuildStatusEnum.InProgress);
            rulesEngine.InvokeStatusChecked(BuildStatusEnum.Broken);

            var lines = rulesEngine.SosDb.ReadAll(RulesEngineWrapper.BUILD1_ID);

            Assert.AreEqual(1, lines.Count);
            var buildDefinition = lines.First();
            Assert.AreEqual("User1", buildDefinition.RequestedBy);
            Assert.AreEqual(new DateTime(2010, 1, 1, 1, 1, 1), buildDefinition.StartedTime);
            Assert.AreEqual(new DateTime(2010, 1, 1, 1, 10, 10), buildDefinition.FinishedTime);
            Assert.AreEqual(null, buildDefinition.Comment);
            Assert.AreEqual(BuildStatusEnum.Broken, buildDefinition.BuildStatusEnum);
        }
開發者ID:mightymuke,項目名稱:SirenOfShame,代碼行數:18,代碼來源:RulesEngineTest.cs

示例8: InitialStatusChecked_RefreshStatus

        public void InitialStatusChecked_RefreshStatus()
        {
            var rulesEngine = new RulesEngineWrapper();

            Assert.AreEqual(1, rulesEngine.RefreshStatusEvents.Count);

            var startedTime = new DateTime(2010, 1, 2, 1, 1, 1);
            var finishedTime = new DateTime(2010, 1, 2, 1, 2, 2);

            rulesEngine.InvokeStatusChecked(new[]
            {
                new BuildStatus
                {
                    BuildStatusEnum = BuildStatusEnum.Working,
                    Name = "Build Def 1",
                    RequestedBy = "User1",
                    BuildDefinitionId = "Build Def 1",
                    StartedTime = startedTime,
                    FinishedTime = finishedTime
                },
            });

            Assert.AreEqual(2, rulesEngine.RefreshStatusEvents.Count);
            Assert.AreEqual(1, rulesEngine.RefreshStatusEvents[1].BuildStatusDtos.Count());
            BuildStatusDto buildStatus = rulesEngine.RefreshStatusEvents[1].BuildStatusDtos.First();
            Assert.AreEqual((int)BallsEnum.Green, buildStatus.ImageIndex);
            Assert.AreEqual("Build Def 1", buildStatus.BuildDefinitionDisplayName);
            Assert.AreEqual("User1", buildStatus.RequestedByRawName);
            Assert.AreEqual("Build Def 1", buildStatus.BuildDefinitionId);
            Assert.AreEqual(BuildStatus.FormatAsDayMonthTime(startedTime), buildStatus.StartTimeShort);
            Assert.AreEqual("1:01", buildStatus.Duration);
        }
開發者ID:mightymuke,項目名稱:SirenOfShame,代碼行數:32,代碼來源:RulesEngineTest.cs

示例9: BuildInProgressThenPassThenInProgressWithGlobalBuildTriggeredRule_TwoAlerts

        public void BuildInProgressThenPassThenInProgressWithGlobalBuildTriggeredRule_TwoAlerts()
        {
            var rulesEngine = new RulesEngineWrapper();

            rulesEngine.Rules.Add(new Rule
            {
                TriggerType = TriggerType.BuildTriggered,
                AlertType = AlertType.TrayAlert
            });

            rulesEngine.InvokeStatusChecked(BuildStatusEnum.InProgress);
            rulesEngine.InvokeStatusChecked(BuildStatusEnum.Working);
            rulesEngine.InvokeStatusChecked(BuildStatusEnum.InProgress);
            Assert.AreEqual(2, rulesEngine.TrayNotificationEvents.Count);
            Assert.AreEqual(rulesEngine.TrayNotificationEvents[0].Title, rulesEngine.TrayNotificationEvents[1].Title);
        }
開發者ID:mightymuke,項目名稱:SirenOfShame,代碼行數:16,代碼來源:RulesEngineTest.cs

示例10: ServerUnavailableThenAvailableThenUnavailable_TwoUnavailableTrayNotificationSent

 public void ServerUnavailableThenAvailableThenUnavailable_TwoUnavailableTrayNotificationSent()
 {
     var rulesEngine = new RulesEngineWrapper();
     rulesEngine.InvokeServerUnavailable(new ServerUnavailableException("The network is down."));
     rulesEngine.InvokeStatusChecked(new BuildStatus[] { });
     rulesEngine.InvokeServerUnavailable(new ServerUnavailableException("The network is down."));
     Assert.AreEqual(3, rulesEngine.TrayNotificationEvents.Count);
     Assert.AreEqual(2,
                     rulesEngine.TrayNotificationEvents.Where(tn => tn.Title == "Build Server Unavailable").Count
                         ());
 }
開發者ID:mightymuke,項目名稱:SirenOfShame,代碼行數:11,代碼來源:RulesEngineTest.cs

示例11: NewBuildWithNewRequestedBy_PersonAdded

        public void NewBuildWithNewRequestedBy_PersonAdded()
        {
            var rulesEngine = new RulesEngineWrapper();

            rulesEngine.Rules.Add(new Rule
            {
                TriggerType = TriggerType.InitialFailedBuild,
                AlertType = AlertType.NoAlert,
            });

            Assert.AreEqual(0, rulesEngine.Settings.CiEntryPointSettings[0].BuildDefinitionSettings[0].People.Count);
            rulesEngine.InvokeStatusChecked(BuildStatusEnum.Broken);
            Assert.AreEqual(1, rulesEngine.Settings.CiEntryPointSettings[0].BuildDefinitionSettings[0].People.Count);
            Assert.AreEqual(RulesEngineWrapper.CURRENT_USER,
                            rulesEngine.Settings.CiEntryPointSettings[0].BuildDefinitionSettings[0].People[0]);
        }
開發者ID:mightymuke,項目名稱:SirenOfShame,代碼行數:16,代碼來源:RulesEngineTest.cs

示例12: IsBuildingWithBuildTriggeredRuleToStopOnSuccess_BuildSucceeds_LedsStop

        public void IsBuildingWithBuildTriggeredRuleToStopOnSuccess_BuildSucceeds_LedsStop()
        {
            var rulesEngine = new RulesEngineWrapper();

            var ledPattern = new LedPattern { Id = 2, Name = "Sally" };
            rulesEngine.Rules.Add(new Rule
            {
                TriggerType = TriggerType.BuildTriggered,
                LedPattern = ledPattern,
                LightsDuration = null,
            });

            Assert.AreEqual(0, rulesEngine.SetLightsEvents.Count);
            rulesEngine.InvokeStatusChecked(BuildStatusEnum.Working);
            Assert.AreEqual(0, rulesEngine.SetLightsEvents.Count);
            rulesEngine.InvokeStatusChecked(BuildStatusEnum.InProgress);
            Assert.AreEqual(1, rulesEngine.SetLightsEvents.Count);
            Assert.AreEqual("Sally", rulesEngine.SetLightsEvents[0].LedPattern.Name);
            rulesEngine.InvokeStatusChecked(BuildStatusEnum.Working);
            Assert.AreEqual(2, rulesEngine.SetLightsEvents.Count);
            Assert.AreEqual(null, rulesEngine.SetLightsEvents[1].LedPattern);
        }
開發者ID:mightymuke,項目名稱:SirenOfShame,代碼行數:22,代碼來源:RulesEngineTest.cs

示例13: GlobalPlayAudioAlertButOnMute_NoAudio

        public void GlobalPlayAudioAlertButOnMute_NoAudio()
        {
            var rulesEngine = new RulesEngineWrapper();

            var audioPattern = new AudioPattern { Id = 2, Name = "Sally" };
            rulesEngine.Rules.Add(new Rule
            {
                TriggerType = TriggerType.InitialFailedBuild,
                AudioPattern = audioPattern,
                AudioDuration = 60,
            });

            rulesEngine.Settings.Mute = true;
            rulesEngine.InvokeStatusChecked(BuildStatusEnum.Broken);
            Assert.AreEqual(0, rulesEngine.SetAudioEvents.Count);
        }
開發者ID:mightymuke,項目名稱:SirenOfShame,代碼行數:16,代碼來源:RulesEngineTest.cs

示例14: GlobalMuteOnBuildFailsWithWindowsAudioRule_NoAudio

 public void GlobalMuteOnBuildFailsWithWindowsAudioRule_NoAudio()
 {
     var rulesEngine = new RulesEngineWrapper();
     rulesEngine.Settings.Mute = true;
     Rule rule = new Rule
     {
         TriggerType = TriggerType.InitialFailedBuild,
         WindowsAudioLocation = "SirenOfShame.Resources.Sad-Trombone.wav"
     };
     rulesEngine.Rules.Add(rule);
     rulesEngine.InvokeStatusChecked(BuildStatusEnum.Working);
     rulesEngine.InvokeStatusChecked(BuildStatusEnum.Broken);
     Assert.AreEqual(0, rulesEngine.PlayWindowsAudioEvents.Count);
 }
開發者ID:mightymuke,項目名稱:SirenOfShame,代碼行數:14,代碼來源:RulesEngineTest.cs

示例15: GlobalBuildDefTrayAlertConflictsWithLocalBuildDefModalAlert_ModalAlertOnly

        public void GlobalBuildDefTrayAlertConflictsWithLocalBuildDefModalAlert_ModalAlertOnly()
        {
            var rulesEngine = new RulesEngineWrapper();

            rulesEngine.Rules.Add(new Rule
            {
                TriggerType = TriggerType.BuildFailed,
                AlertType = AlertType.TrayAlert,
            });
            rulesEngine.Rules.Add(new Rule
            {
                TriggerType = TriggerType.BuildFailed,
                AlertType = AlertType.ModalDialog,
                BuildDefinitionId = RulesEngineWrapper.BUILD1_ID
            });

            rulesEngine.InvokeStatusChecked(BuildStatusEnum.Broken);
            Assert.AreEqual(1, rulesEngine.ModalDialogEvents.Count);
            Assert.AreEqual(0, rulesEngine.TrayNotificationEvents.Count);
        }
開發者ID:mightymuke,項目名稱:SirenOfShame,代碼行數:20,代碼來源:RulesEngineTest.cs


注:本文中的SirenOfShame.Test.Unit.Watcher.RulesEngineWrapper.InvokeStatusChecked方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。