Ejemplo n.º 1
0
        void IWizardPage.WizardEvent(WizardEventArgs WizardEventArgs)
        {
            if (WizardEventArgs.EventType == EventType.Init)
            {
                UploadItemToRepositoryWizard = ((UploadItemToRepositoryWizard)WizardEventArgs.Wizard);
            }
            else if (WizardEventArgs.EventType == EventType.Active)
            {
                foreach (UploadItemSelection selectedItem in UploadItemSelection.mSelectedItems)
                {
                    if (selectedItem.Selected)
                    {
                        if (selectedItem.ItemUploadStatus != UploadItemSelection.eItemUploadStatus.Uploaded)
                        {
                            SharedRepositoryOperations.UploadItemToRepository(selectedItem);
                        }
                    }
                    else
                    {
                        selectedItem.ItemUploadStatus = UploadItemSelection.eItemUploadStatus.Skipped;
                    }
                }

                // UploadItemToRepositoryWizard.PrevVisible = false;
                // UploadItemToRepositoryWizard.NextVisible = false;
                // UploadItemToRepositoryWizard.mWizardWindow.CancelButton.Visibility = System.Windows.Visibility.Collapsed; /// WHY FIXME
                // UploadItemToRepositoryWizard.FinishEnabled = true;
            }
        }
Ejemplo n.º 2
0
        public void TestActivityVariablesSyncWithRepo_v2()
        {
            string variableName = "ACTVAR2";
            string initialValue = "123";
            string updatedValue = "abc123";

            mBF = new BusinessFlow()
            {
                Name = "TestActvVarSyncV2", Active = true
            };
            mBF.Activities = new ObservableList <Activity>();

            VariableString V1 = new VariableString()
            {
                Name = variableName, InitialStringValue = initialValue
            };

            // add variable to the activity
            Activity activity = new Activity()
            {
                ActivityName = "Activity1"
            };

            activity.AddVariable(V1);
            mBF.Activities.Add(activity);

            // add business flow to the solution repository
            mSolutionRepository.AddRepositoryItem(mBF);

            // prepare to add the variable to the shared repository
            UploadItemSelection uploadItemSelection = new UploadItemSelection()
            {
                UsageItem = V1, ItemUploadType = UploadItemSelection.eItemUploadType.New
            };

            SharedRepositoryOperations.UploadItemToRepository(uploadItemSelection);

            // find the newly added variable in the shared repo
            VariableBase   sharedVariableBase = (from x in mSolutionRepository.GetAllRepositoryItems <VariableBase>() where x.Name == variableName select x).SingleOrDefault();
            VariableString sharedV1           = (VariableString)sharedVariableBase;

            //update the new value in the shared repo variable
            sharedV1.InitialStringValue = updatedValue;

            //sync the updated instance with the business flow instance
            sharedV1.UpdateInstance(V1, "All", mBF.Activities[0]);

            // get the updated value from the business flow
            VariableString V2 = (VariableString)mBF.Activities[0].Variables[0];

            //Assert
            Assert.AreEqual(1, mBF.Activities.Count);
            Assert.AreEqual(1, mBF.Activities[0].Variables.Count);
            Assert.AreNotSame(V1, V2);
            Assert.AreEqual(updatedValue, V2.InitialStringValue);
        }