SetModelItemForServiceTypes() 공개 메소드

public SetModelItemForServiceTypes ( IDataObject dataObject ) : bool
dataObject IDataObject
리턴 bool
        public void SequenceDesignerViewModel_SetModelItemForServiceTypes_DataHaveDataContextResourceModel_NothingAddedToDataObject()
        {
            //------------Setup for test--------------------------
            var dsfSequenceActivity = new DsfSequenceActivity();
            var dsfMultiAssignActivity = new DsfMultiAssignActivity();
            dsfSequenceActivity.Activities.Add(dsfMultiAssignActivity);
            SetupEnvironmentRepo(Guid.Empty);
            var sequenceDesignerViewModel = new SequenceDesignerViewModel(CreateModelItem(dsfSequenceActivity));
            var dataObject = new DataObject(GlobalConstants.ExplorerItemModelFormat, new ExplorerItemModel { DisplayName = "MyDBService", ResourceType = ResourceType.DbService, EnvironmentId = Guid.Empty });
            //------------Execute Test---------------------------
            bool added = sequenceDesignerViewModel.SetModelItemForServiceTypes(dataObject);
            //------------Assert Results-------------------------
            Assert.IsTrue(added);
            Assert.AreEqual(2, dsfSequenceActivity.Activities.Count);

        }
 public void SequenceDesignerViewModel_SetModelItemForServiceTypes_Data_NothingAddedToDataObject()
 {
     //------------Setup for test--------------------------
     var dsfSequenceActivity = new DsfSequenceActivity();
     var dsfMultiAssignActivity = new DsfMultiAssignActivity();
     dsfSequenceActivity.Activities.Add(dsfMultiAssignActivity);
     var sequenceDesignerViewModel = new SequenceDesignerViewModel(CreateModelItem(dsfSequenceActivity));
     var dataObject = new DataObject("Some Wrong Format", new object());
     //------------Execute Test---------------------------
     sequenceDesignerViewModel.SetModelItemForServiceTypes(dataObject);
     //------------Assert Results-------------------------
     bool dataPresent = dataObject.GetDataPresent(DragDropHelper.ModelItemDataFormat);
     Assert.IsFalse(dataPresent);
 }
 public void SequenceDesignerViewModel_SetModelItemForServiceTypes_DataHaveDataContextNotResourceModel_NothingAddedToDataObject()
 {
     //------------Setup for test--------------------------
     var dsfSequenceActivity = new DsfSequenceActivity();
     var dsfMultiAssignActivity = new DsfMultiAssignActivity();
     dsfSequenceActivity.Activities.Add(dsfMultiAssignActivity);
     var sequenceDesignerViewModel = new SequenceDesignerViewModel(CreateModelItem(dsfSequenceActivity));
     var dataObject = new DataObject(GlobalConstants.ExplorerItemModelFormat, new TestDataWithContext());
     //------------Execute Test---------------------------
     sequenceDesignerViewModel.SetModelItemForServiceTypes(dataObject);
     //------------Assert Results-------------------------
     bool dataPresent = dataObject.GetDataPresent(DragDropHelper.ModelItemDataFormat);
     Assert.IsFalse(dataPresent);
 }
 public void SequenceDesignerViewModel_SetModelItemForServiceTypes_DataObjectNull_NothingAddedToDataObject()
 {
     //------------Setup for test--------------------------
     var dsfSequenceActivity = new DsfSequenceActivity();
     var dsfMultiAssignActivity = new DsfMultiAssignActivity();
     dsfSequenceActivity.Activities.Add(dsfMultiAssignActivity);
     var sequenceDesignerViewModel = new SequenceDesignerViewModel(CreateModelItem(dsfSequenceActivity));
     //------------Execute Test---------------------------
     var modelItemForServiceTypes = sequenceDesignerViewModel.SetModelItemForServiceTypes(null);
     //------------Assert Results-------------------------
     Assert.IsFalse(modelItemForServiceTypes);
 }