Utility class used for the foreach activity designer backing logic
 public Small()
 {
     InitializeComponent();
     DropPoint.PreviewDragOver += DropPoint_OnDragOver;
     DropPoint.PreviewDrop += DropPoint_OnPreviewDrop;
     _dropEnabledActivityDesignerUtils = new DropEnabledActivityDesignerUtils();
 }
 public Large()
 {
     InitializeComponent();
     Loaded += (sender, args) => SetProperties();
     ActivitiesPresenter.PreviewDrop += DoDrop;
     ActivitiesPresenter.PreviewDragOver += DropPointOnDragEnter;
     _dropEnabledActivityDesignerUtils = new DropEnabledActivityDesignerUtils();
 }
 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);
 }
 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);
 }
 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);
 }
 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_NotSwitchDecisionModelItem_DropNotPrevented()
 {
     //------------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 DsfMultiAssignActivity());
     dataObject.Setup(o => o.GetData(It.IsAny<string>())).Returns(modelItem);
     //------------Execute Test---------------------------
     var dropEnabled = activityDesignerUtils.LimitDragDropOptions(dataObject.Object);
     //------------Assert Results-------------------------
     Assert.IsTrue(dropEnabled);
 }