Esempio n. 1
0
        protected override IList <ITest> GetTests(QualitySpecification specification,
                                                  out QualityVerification qualityVerification)
        {
            IList <ITest>       result       = null;
            QualityVerification verification = null;

            // TODO: Copy from QualityVerificationService
            // Consider moving to base or provide the (properly initialized) tests together with the
            // verification in VerifyQuality() or move the condition/test dictionaries and collections
            // to a separate factory/provider class that can be called previously inside the appropriate
            // transaction
            _domainTransactions.UseTransaction(
                delegate
            {
                ICollection <Dataset> datasets =
                    QualitySpecificationUtils.GetQualityConditionDatasets(specification);

                _domainTransactions.Reattach(datasets);

                _backgroundVerificationInputs.InitializeSchema(datasets);

                result = GetTestsCore(specification, out verification);
            });

            qualityVerification = verification;
            return(result);
        }
Esempio n. 2
0
        public QualityVerification GetQualityVerification()
        {
            if (_qualityVerification == null)
            {
                _domainTransactions.UseTransaction(
                    () =>
                {
                    if (VerificationMsg.SavedVerificationId >= 0)
                    {
                        _qualityVerification =
                            _qualityVerificationRepository.Get(
                                VerificationMsg.SavedVerificationId);

                        Assert.NotNull(_qualityVerification, "Quality verification not found.");

                        _domainTransactions.Initialize(
                            _qualityVerification.ConditionVerifications);
                        _domainTransactions.Initialize(
                            _qualityVerification.VerificationDatasets);
                    }
                    else
                    {
                        _qualityVerification = GetQualityVerificationTx(VerificationMsg);
                    }
                });
            }

            return(_qualityVerification);
        }
Esempio n. 3
0
        public static void ShowResults(
            [CanBeNull] IWin32Window owner,
            [NotNull] QualityVerification verification,
            string contextType,
            string contextName,
            [NotNull] IDomainTransactionManager domainTransactionManager)
        {
            Assert.ArgumentNotNull(verification, nameof(verification));
            Assert.ArgumentNotNull(domainTransactionManager, nameof(domainTransactionManager));

            using (var form = new QAVerificationForm(domainTransactionManager))
            {
                domainTransactionManager.UseTransaction(
                    delegate
                {
                    Initialize(verification, domainTransactionManager);

                    // ReSharper disable once AccessToDisposedClosure
                    form.SetVerification(verification,
                                         contextType,
                                         contextName);
                });

                form.StartPosition = FormStartPosition.CenterScreen;
                //if (owner != null)
                //{
                //    owner = owner.TopLevelControl;
                //}
                UIEnvironment.ShowDialog(form, owner);
            }
        }
Esempio n. 4
0
        private void SetQualityConditionVerification(
            [NotNull] QualityConditionVerification conditionVerification)
        {
            Assert.ArgumentNotNull(conditionVerification, nameof(conditionVerification));

            _domainTransactionManager.UseTransaction(
                delegate
            {
                QualityCondition condition = conditionVerification.DisplayableCondition;

                if (condition.IsPersistent)
                {
                    _domainTransactionManager.Reattach(condition);
                }

                _qualityConditionVerificationControl.SetCondition(conditionVerification);
            });
        }