public void ShouldNotImportDuplicateCommits() { var repo = new MercurialTestRepositoryWithCherryPickedCommit(); var transportMock = ObjectFactory.GetInstance <TransportMock>(); var mercurialPluginProfile = new MercurialPluginProfile { Uri = repo.Uri.ToString(), Login = repo.Login, Password = repo.Password, StartRevision = "1/1/1980" }; var profile = transportMock.AddProfile("CherryPick", mercurialPluginProfile); using (var mercurial = CreateMercurial(mercurialPluginProfile)) { var startRevisionId = CreateMercurialRevisionId(MercurialRevisionId.UtcTimeMin); var revisionRange = mercurial.GetFromTillHead(startRevisionId, 100).Single(); transportMock.HandleLocalMessage(profile, new NewRevisionRangeDetectedLocalMessage { Range = revisionRange }); transportMock.TpQueue.GetMessages <CreateCommand>().Count(x => x.Dto is RevisionDTO).Should(Be.EqualTo(1)); } }
private string RunValidation(string uri, string login, string password) { var profile = new MercurialPluginProfile(); PluginProfileErrorCollection errors = new PluginProfileErrorCollection(); profile.Uri = uri; profile.Login = login; profile.Password = password; var methodInfo = typeof(MercurialPluginProfile).GetMethod( "ValidateCredentialsInUri", BindingFlags.NonPublic | BindingFlags.Instance); methodInfo.Invoke(profile, new object[] { errors }); return(profile.Uri); }
public void ShouldNotImportDuplicateCommits() { var repo = new MercurialTestRepositoryWithCherryPickedCommit(); var transportMock = ObjectFactory.GetInstance<TransportMock>(); var mercurialPluginProfile = new MercurialPluginProfile { Uri = repo.Uri.ToString(), Login = repo.Login, Password = repo.Password, StartRevision = "1/1/1980" }; var profile = transportMock.AddProfile("CherryPick", mercurialPluginProfile); using (var mercurial = CreateMercurial(mercurialPluginProfile)) { var startRevisionId = CreateMercurialRevisionId(MercurialRevisionId.UtcTimeMin); var revisionRange = mercurial.GetFromTillHead(startRevisionId, 100).Single(); transportMock.HandleLocalMessage(profile, new NewRevisionRangeDetectedLocalMessage {Range = revisionRange}); transportMock.TpQueue.GetMessages<CreateCommand>().Count(x => x.Dto is RevisionDTO).Should(Be.EqualTo(1)); } }