Esempio n. 1
0
        public void ExportImportProjectNoMergeServiceTest()
        {
            SampleData.ClearDatabaseThenImportDefaultProject();

            ExportProject(SampleData.GetProjectId(), false);
        }
Esempio n. 2
0
        public void TestsIsActionInternalExternalDeletedMutuallyExclusive()
        {
            SampleData.ClearDatabaseThenImportDefaultProject();
            // Vérifie dans toutes les actions de la BDD si les actions sont soi I, E ou S et jamais aucun des trois ou plus d'un des 3 à la fois.
            var prepareService = new PrepareService();
            var analyzeService = new AnalyzeService();
            var mre            = new System.Threading.ManualResetEvent(false);

            ProjectsData pData     = null;
            Exception    exception = null;

            prepareService.GetProjects(d =>
            {
                pData = d;
                mre.Set();
            }, ex =>
            {
                exception = ex;
                mre.Set();
            });

            mre.WaitOne();
            AssertExt.IsExceptionNull(exception);

            foreach (var project in pData.Projects)
            {
                mre.Reset();
                RestitutionData rData = null;
                analyzeService.GetFullProjectDetails(project.ProjectId, d =>
                {
                    rData = d;
                    mre.Set();
                }, ex =>
                {
                    exception = ex;
                    mre.Set();
                });

                mre.WaitOne();
                AssertExt.IsExceptionNull(exception);

                foreach (var scenario in rData.Scenarios)
                {
                    foreach (var action in scenario.Actions)
                    {
                        bool i = ActionsTimingsMoveManagement.IsActionInternal(action);
                        bool e = ActionsTimingsMoveManagement.IsActionExternal(action);
                        bool s = ActionsTimingsMoveManagement.IsActionDeleted(action);

                        Assert.IsTrue(i || e || s);

                        if (i)
                        {
                            Assert.IsFalse(e || s);
                        }
                        else if (e)
                        {
                            Assert.IsFalse(i || s);
                        }
                        else
                        {
                            Assert.IsFalse(i || e);
                        }
                    }
                }
            }
        }