コード例 #1
0
ファイル: SosDbTest.cs プロジェクト: mightymuke/SirenOfShame
 public void ExportNewBuilds_InitialExportWithNoBuilds_Null()
 {
     SosDbFake sosDb = new SosDbFake();
     SirenOfShameSettings settings = new SirenOfShameSettings(useMef: false)
     {
         SosOnlineHighWaterMark = null,
         MyRawName = "CurrentUser"
     };
     sosDb.Write(new BuildStatus { BuildDefinitionId = "BD"}, settings);
     var result = sosDb.ExportNewBuilds(settings);
     Assert.IsNull(result);
 }
コード例 #2
0
ファイル: SosDbTest.cs プロジェクト: pmiossec/SirenOfShame
        public void ExportNewBuilds_InitialExportWithNoBuilds_Null()
        {
            SosDbFake            sosDb    = new SosDbFake();
            SirenOfShameSettings settings = new SirenOfShameSettingsFake
            {
                SosOnlineHighWaterMark = null,
                MyRawName = "CurrentUser"
            };

            sosDb.Write(new BuildStatus {
                BuildDefinitionId = "BD"
            }, settings, true);
            var result = sosDb.ExportNewBuilds(settings);

            Assert.IsNull(result);
        }
コード例 #3
0
ファイル: SosDbTest.cs プロジェクト: pmiossec/SirenOfShame
        public void ExportNewBuilds_InitialExportWithOneSuccessfulBuildByCurrentUser_Exports()
        {
            SosDbFake            sosDb    = new SosDbFake();
            SirenOfShameSettings settings = new SirenOfShameSettingsFake
            {
                SosOnlineHighWaterMark = null,
                MyRawName            = "CurrentUser",
                CiEntryPointSettings = new List <CiEntryPointSetting>
                {
                    new CiEntryPointSetting
                    {
                        BuildDefinitionSettings = new List <BuildDefinitionSetting>
                        {
                            new BuildDefinitionSetting
                            {
                                Id     = "BuildDefinitionId",
                                Active = true
                            }
                        }
                    }
                }
            };

            sosDb.Write(new BuildStatus
            {
                StartedTime       = new DateTime(2010, 1, 1, 1, 1, 1),
                FinishedTime      = new DateTime(2010, 1, 1, 1, 1, 2),
                BuildStatusEnum   = BuildStatusEnum.Working,
                BuildDefinitionId = "BuildDefinitionId",
                BuildId           = "BuildId",
                Name        = "Name",
                RequestedBy = "CurrentUser",
                Comment     = "Comment",
            }, settings, false);
            var result = sosDb.ExportNewBuilds(settings);

            Assert.AreEqual("633979044610000000,633979044620000000,1", result);
        }
コード例 #4
0
ファイル: SosDbTest.cs プロジェクト: benoit808/SirenOfShame
        public void ExportNewBuilds_SecondExportGetsNewerExports()
        {
            SosDbFake            sosDb    = new SosDbFake();
            SirenOfShameSettings settings = new SirenOfShameSettingsFake
            {
                SosOnlineHighWaterMark = 633979044610000000,
                MyRawName            = "CurrentUser",
                CiEntryPointSettings = new List <CiEntryPointSetting>
                {
                    new CiEntryPointSetting
                    {
                        BuildDefinitionSettings = new List <BuildDefinitionSetting>
                        {
                            new BuildDefinitionSetting
                            {
                                Id     = "BuildDefinitionId",
                                Active = true
                            }
                        }
                    }
                }
            };

            sosDb.Write(new BuildStatus
            {
                StartedTime       = new DateTime(2010, 1, 1, 1, 1, 2),
                FinishedTime      = new DateTime(2010, 1, 1, 1, 1, 3),
                BuildStatusEnum   = BuildStatusEnum.Broken,
                BuildDefinitionId = "BuildDefinitionId",
                BuildId           = "BuildId",
                Name        = "Name",
                RequestedBy = "CurrentUser",
                Comment     = "Comment",
            }, settings);
            var result = sosDb.ExportNewBuilds(settings);

            Assert.AreEqual("633979044620000000,633979044630000000,0", result);
        }
コード例 #5
0
ファイル: SosDbTest.cs プロジェクト: mightymuke/SirenOfShame
 public void ExportNewBuilds_InitialExportWithOneSuccessfulBuildByCurrentUser_Exports()
 {
     SosDbFake sosDb = new SosDbFake();
     SirenOfShameSettings settings = new SirenOfShameSettings(useMef: false)
     {
         SosOnlineHighWaterMark = null,
         MyRawName = "CurrentUser",
         CiEntryPointSettings = new List<CiEntryPointSetting>
         {
             new CiEntryPointSetting
             {
                 BuildDefinitionSettings = new List<BuildDefinitionSetting>
                 {
                     new BuildDefinitionSetting
                     {
                         Id = "BuildDefinitionId",
                         Active = true
                     }
                 }
             }
         }
     };
     sosDb.Write(new BuildStatus
         {
             StartedTime = new DateTime(2010, 1, 1, 1, 1, 1),
             FinishedTime = new DateTime(2010, 1, 1, 1, 1, 2),
             BuildStatusEnum = BuildStatusEnum.Working,
             BuildDefinitionId = "BuildDefinitionId",
             BuildId = "BuildId",
             Name = "Name",
             RequestedBy = "CurrentUser",
             Comment = "Comment",
         }, settings);
     var result = sosDb.ExportNewBuilds(settings);
     Assert.AreEqual("633979044610000000,633979044620000000,1", result);
 }
コード例 #6
0
ファイル: SosDbTest.cs プロジェクト: pmiossec/SirenOfShame
        public void ExportNewBuilds_SecondExportIgnoresOlderExports()
        {
            SosDbFake            sosDb    = new SosDbFake();
            SirenOfShameSettings settings = new SirenOfShameSettingsFake
            {
                SosOnlineHighWaterMark = 633979044610000000,
                MyRawName = "CurrentUser"
            };

            sosDb.Write(new BuildStatus
            {
                StartedTime       = new DateTime(2010, 1, 1, 1, 1, 1),
                FinishedTime      = new DateTime(2010, 1, 1, 1, 1, 2),
                BuildStatusEnum   = BuildStatusEnum.Working,
                BuildDefinitionId = "BuildDefinitionId",
                BuildId           = "BuildId",
                Name        = "Name",
                RequestedBy = "CurrentUser",
                Comment     = "Comment",
            }, settings, true);
            var result = sosDb.ExportNewBuilds(settings);

            Assert.AreEqual(null, result);
        }
コード例 #7
0
ファイル: SosDbTest.cs プロジェクト: pmiossec/SirenOfShame
        public void ExportNewBuilds_InitialExportWithOneSuccessfulBuildBySomeoneElse_Null()
        {
            SosDbFake            sosDb    = new SosDbFake();
            SirenOfShameSettings settings = new SirenOfShameSettingsFake
            {
                SosOnlineHighWaterMark = null,
                MyRawName = "CurrentUser"
            };

            sosDb.Write(new BuildStatus
            {
                StartedTime       = new DateTime(2010, 1, 1, 1, 1, 1),
                FinishedTime      = new DateTime(2010, 1, 1, 1, 1, 2),
                BuildStatusEnum   = BuildStatusEnum.Working,
                BuildDefinitionId = "BuildDefinitionId",
                BuildId           = "BuildId",
                Name        = "Name",
                RequestedBy = "SomeoneElse",
                Comment     = "Comment",
            }, settings, true);
            var result = sosDb.ExportNewBuilds(settings);

            Assert.AreEqual(null, result);
        }
コード例 #8
0
ファイル: SosDbTest.cs プロジェクト: mightymuke/SirenOfShame
 public void ExportNewBuilds_InitialExportWithOneSuccessfulBuildBySomeoneElse_Null()
 {
     SosDbFake sosDb = new SosDbFake();
     SirenOfShameSettings settings = new SirenOfShameSettings(useMef: false)
     {
         SosOnlineHighWaterMark = null,
         MyRawName = "CurrentUser"
     };
     sosDb.Write(new BuildStatus
     {
         StartedTime = new DateTime(2010, 1, 1, 1, 1, 1),
         FinishedTime = new DateTime(2010, 1, 1, 1, 1, 2),
         BuildStatusEnum = BuildStatusEnum.Working,
         BuildDefinitionId = "BuildDefinitionId",
         BuildId = "BuildId",
         Name = "Name",
         RequestedBy = "SomeoneElse",
         Comment = "Comment",
     }, settings);
     var result = sosDb.ExportNewBuilds(settings);
     Assert.AreEqual(null, result);
 }
コード例 #9
0
ファイル: SosDbTest.cs プロジェクト: mightymuke/SirenOfShame
 public void ExportNewBuilds_SecondExportIgnoresOlderExports()
 {
     SosDbFake sosDb = new SosDbFake();
     SirenOfShameSettings settings = new SirenOfShameSettings(useMef: false)
     {
         SosOnlineHighWaterMark = 633979044610000000,
         MyRawName = "CurrentUser"
     };
     sosDb.Write(new BuildStatus
     {
         StartedTime = new DateTime(2010, 1, 1, 1, 1, 1),
         FinishedTime = new DateTime(2010, 1, 1, 1, 1, 2),
         BuildStatusEnum = BuildStatusEnum.Working,
         BuildDefinitionId = "BuildDefinitionId",
         BuildId = "BuildId",
         Name = "Name",
         RequestedBy = "CurrentUser",
         Comment = "Comment",
     }, settings);
     var result = sosDb.ExportNewBuilds(settings);
     Assert.AreEqual(null, result);
 }
コード例 #10
0
 public void ExportNewBuilds_SecondExportGetsNewerExports()
 {
     SosDbFake sosDb = new SosDbFake();
     SirenOfShameSettings settings = new SirenOfShameSettingsFake
     {
         SosOnlineHighWaterMark = 633979044610000000,
         MyRawName = "CurrentUser",
         CiEntryPointSettings = new List<CiEntryPointSetting>
         {
             new CiEntryPointSetting
             {
                 BuildDefinitionSettings = new List<BuildDefinitionSetting>
                 {
                     new BuildDefinitionSetting
                     {
                         Id = "BuildDefinitionId",
                         Active = true
                     }
                 }
             }
         }
     };
     sosDb.Write(new BuildStatus
     {
         StartedTime = new DateTime(2010, 1, 1, 1, 1, 2),
         FinishedTime = new DateTime(2010, 1, 1, 1, 1, 3),
         BuildStatusEnum = BuildStatusEnum.Broken,
         BuildDefinitionId = "BuildDefinitionId",
         BuildId = "BuildId",
         Name = "Name",
         RequestedBy = "CurrentUser",
         Comment = "Comment",
     }, settings, false);
     var result = sosDb.ExportNewBuilds(settings);
     Assert.AreEqual("633979044620000000,633979044630000000,0", result);
 }