Ejemplo n.º 1
0
        private string GetGlossFromLanguageDepot(Guid testEntryGuid, int expectedSensesCount)
        {
            // Since there is no direct way to check the XML files checked in to Mercurial, we
            // do it indirectly by re-cloning the repo from LD and checking the new clone.
            _lfProject.FieldWorksProject.Dispose();
            Directory.Delete(_lfProject.ProjectDir, true);
            var ensureClone = new EnsureCloneAction(_env.Settings, _env.Logger, _recordFactory, _mongoConnection);

            ensureClone.Run(_lfProject);
            return(GetGlossFromFdo(testEntryGuid, expectedSensesCount));
        }
Ejemplo n.º 2
0
        public void Error_NotAFlexProject()
        {
            // Setup
            // Create a non-FLEx hg repo (in this case an empty repo)
            var lDProjectFolderPath = LanguageDepotMock.ProjectFolderPath;

            MercurialTestHelper.InitializeHgRepo(lDProjectFolderPath);
            File.WriteAllText(Path.Combine(lDProjectFolderPath, "some.file"),
                              "just a test file");
            MercurialTestHelper.HgCommit(lDProjectFolderPath, "Initial commit");

            // Execute
            _EnsureCloneAction.Run(_lfProject);

            // Verify
            Assert.That(_env.Logger.GetErrors(), Does.Contain("clone is not a FLEx project"));
            Assert.That(_lfProject.State.SRState, Is.EqualTo(ProcessingState.SendReceiveStates.ERROR));
            Assert.That(ModelVersion, Is.EqualTo(0));
            Assert.That(Directory.Exists(_lfProject.ProjectDir), Is.False);
        }