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