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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }