Exemple #1
0
 public Large()
 {
     InitializeComponent();
     Loaded += (sender, args) => SetProperties();
     ActivitiesPresenter.PreviewDrop  += DoDrop;
     _dropEnabledActivityDesignerUtils = new DropEnabledActivityDesignerUtils();
 }
 public Small()
 {
     InitializeComponent();
     DropPoint.PreviewDrop            += DoDrop;
     DropPoint.PreviewDragOver        += DropPointOnDragEnter;
     _dropEnabledActivityDesignerUtils = new DropEnabledActivityDesignerUtils();
 }
Exemple #3
0
        public void ForeachActivityDesignerUtils_LimitDragDropOptions_NoWorkflowItemTypeNameFormatAndNoModelItemFormat_EnableDrop()
        {
            //------------Setup for test--------------------------
            var activityDesignerUtils = new DropEnabledActivityDesignerUtils();
            var dataObject            = new Mock <IDataObject>();

            dataObject.Setup(o => o.GetFormats()).Returns(new[] { "SomeOtherFormat" });
            //------------Execute Test---------------------------
            var dropEnabled = activityDesignerUtils.LimitDragDropOptions(dataObject.Object);

            //------------Assert Results-------------------------
            Assert.IsTrue(dropEnabled);
        }
Exemple #4
0
        public void ForeachActivityDesignerUtils_LimitDragDropOptions_NoFormats_EnableDrop()
        {
            //------------Setup for test--------------------------
            var activityDesignerUtils = new DropEnabledActivityDesignerUtils();
            var dataObject            = new Mock <IDataObject>();

            dataObject.Setup(o => o.GetFormats()).Returns(new string[] { });
            //------------Execute Test---------------------------
            var dropEnabled = activityDesignerUtils.LimitDragDropOptions(dataObject.Object);

            //------------Assert Results-------------------------
            Assert.IsTrue(dropEnabled);
        }
Exemple #5
0
        public void ForeachActivityDesignerUtils_LimitDragDropOptions_ModelItemFormat_Decision_DropPrevented()
        {
            //------------Setup for test--------------------------
            var activityDesignerUtils = new DropEnabledActivityDesignerUtils();
            var dataObject            = new Mock <IDataObject>();

            dataObject.Setup(o => o.GetFormats()).Returns(new[] { "ModelItemFormat" });
            dataObject.Setup(o => o.GetData(It.IsAny <string>())).Returns("Decision");
            //------------Execute Test---------------------------
            var dropEnabled = activityDesignerUtils.LimitDragDropOptions(dataObject.Object);

            //------------Assert Results-------------------------
            Assert.IsFalse(dropEnabled);
        }
Exemple #6
0
        public void ForeachActivityDesignerUtils_LimitDragDropOptions_WorkflowItemTypeNameFormat_NotSwitch_DropNotPrevented()
        {
            //------------Setup for test--------------------------
            var activityDesignerUtils = new DropEnabledActivityDesignerUtils();
            var dataObject            = new Mock <IDataObject>();

            dataObject.Setup(o => o.GetFormats()).Returns(new[] { "WorkflowItemTypeNameFormat" });
            dataObject.Setup(o => o.GetData(It.IsAny <string>())).Returns("Activity");
            //------------Execute Test---------------------------
            var dropEnabled = activityDesignerUtils.LimitDragDropOptions(dataObject.Object);

            //------------Assert Results-------------------------
            Assert.IsTrue(dropEnabled);
        }
Exemple #7
0
        public void ForeachActivityDesignerUtils_LimitDragDropOptions_WorkflowItemTypeNameFormat_SwitchModelItem_DropPrevented()
        {
            //------------Setup for test--------------------------
            var activityDesignerUtils = new DropEnabledActivityDesignerUtils();
            var dataObject            = new Mock <IDataObject>();

            dataObject.Setup(o => o.GetFormats()).Returns(new[] { "WorkflowItemTypeNameFormat" });
            var modelItem = ModelItemUtils.CreateModelItem(new FlowSwitch <string>());

            dataObject.Setup(o => o.GetData(It.IsAny <string>())).Returns(modelItem);
            //------------Execute Test---------------------------
            var dropEnabled = activityDesignerUtils.LimitDragDropOptions(dataObject.Object);

            //------------Assert Results-------------------------
            Assert.IsFalse(dropEnabled);
        }
Exemple #8
0
        public void ForeachActivityDesignerUtils_LimitDragDropOptions_ModelItemFormat_NotSwitchDecision_DropNotPrevented()
        {
            //------------Setup for test--------------------------
            var activityDesignerUtils = new DropEnabledActivityDesignerUtils();
            var dataObject            = new Mock <IDataObject>();

            dataObject.Setup(o => o.GetFormats()).Returns(new[] { "ModelItemFormat" });
            var modelItem = ModelItemUtils.CreateModelItem(new DsfMultiAssignActivity());

            dataObject.Setup(o => o.GetData(It.IsAny <string>())).Returns(modelItem);
            //------------Execute Test---------------------------
            var dropEnabled = activityDesignerUtils.LimitDragDropOptions(dataObject.Object);

            //------------Assert Results-------------------------
            Assert.IsTrue(dropEnabled);
        }
        public void ForeachActivityDesignerUtils_LimitDragDropOptions_WorkflowItemTypeNameFormat_SelectAndApplyModelItem_DropPrevented()
        {
            //------------Setup for test--------------------------
            var activityDesignerUtils = new DropEnabledActivityDesignerUtils();
            var dataObject            = new Mock <IDataObject>();

            dataObject.Setup(o => o.GetFormats()).Returns(new[] { "WorkflowItemTypeNameFormat" });
            dataObject.Setup(o => o.GetData(It.IsAny <string>())).Returns("SelectAndApply");
            //------------Execute Test---------------------------
            var shell = new Mock <IShellViewModel>();

            CustomContainer.Register(shell.Object);
            var dropEnabled = activityDesignerUtils.LimitDragDropOptions(dataObject.Object);

            //------------Assert Results-------------------------
            Assert.IsFalse(dropEnabled);
        }
Exemple #10
0
        public void ForeachActivityDesignerUtils_LimitDragDropOptions_ModelItemsFormat_WithDecisionAndCount_DropPrevented()
        {
            //------------Setup for test--------------------------
            var activityDesignerUtils = new DropEnabledActivityDesignerUtils();
            var dataObject            = new Mock <IDataObject>();

            dataObject.Setup(o => o.GetFormats()).Returns(new[] { "ModelItemsFormat" });
            var modelItemList = new List <ModelItem> {
                ModelItemUtils.CreateModelItem(new DsfCountRecordsetActivity()), ModelItemUtils.CreateModelItem(new FlowDecision())
            };

            dataObject.Setup(o => o.GetData(It.IsAny <string>())).Returns(modelItemList);
            //------------Execute Test---------------------------
            var dropEnabled = activityDesignerUtils.LimitDragDropOptions(dataObject.Object);

            //------------Assert Results-------------------------
            Assert.IsFalse(dropEnabled);
        }
        public void ForeachActivityDesignerUtils_LimitDragDropOptions_WorkflowItemTypeNameFormat_SwitchModelItem_DropPrevented()
        {
            //------------Setup for test--------------------------
            var activityDesignerUtils = new DropEnabledActivityDesignerUtils();
            var mock = new Mock <IShellViewModel>();

            mock.Setup(model => model.ShowPopup(It.IsAny <IPopupMessage>()));
            CustomContainer.Register(mock.Object);
            var dataObject = new Mock <IDataObject>();

            dataObject.Setup(o => o.GetFormats()).Returns(new[] { "WorkflowItemTypeNameFormat" });
            var modelItem = ModelItemUtils.CreateModelItem(new FlowSwitch <string>());

            dataObject.Setup(o => o.GetData(It.IsAny <string>())).Returns(modelItem);
            //------------Execute Test---------------------------
            var dropEnabled = activityDesignerUtils.LimitDragDropOptions(dataObject.Object);

            //------------Assert Results-------------------------
            Assert.IsFalse(dropEnabled);
            mock.VerifyAll();
        }
Exemple #12
0
 public Large()
 {
     InitializeComponent();
     DropPoint.PreviewDrop            += DropPoint_OnPreviewDrop;
     _dropEnabledActivityDesignerUtils = new DropEnabledActivityDesignerUtils();
 }
Exemple #13
0
 public Small()
 {
     InitializeComponent();
     _dropEnabledActivityDesignerUtils = new DropEnabledActivityDesignerUtils();
 }