public void CreatePresetStateImplTest()
        {
            //Arrange
            string openPath = Path.Combine(TestDirectory, @"core\DetailedPreviewMargin_Test.dyn");

            RunModel(openPath);
            var guidState = Guid.NewGuid();

            //This will add a new DSFunction node to the current workspace
            var addNode = new DSFunction(CurrentDynamoModel.LibraryServices.GetFunctionDescriptor("+"));

            CurrentDynamoModel.CurrentWorkspace.AddAndRegisterNode(addNode, false);

            //Select the node created (DSFunction)
            DynamoSelection.Instance.Selection.Add(addNode);
            var ids = DynamoSelection.Instance.Selection.OfType <NodeModel>().Select(x => x.GUID).ToList();
            var addPresetCommand = new AddPresetCommand("PresetName", "Preset Description", ids);

            //Act
            addPresetCommand.Execute(CurrentDynamoModel);

            //Assert
            //Validates that the AddPresetCommand was created correctly
            Assert.IsNotNull(addPresetCommand);
            Assert.AreEqual(addPresetCommand.PresetStateName, "PresetName");
            Assert.AreEqual(addPresetCommand.PresetStateDescription, "Preset Description");
        }
        void CreatePresetStateImpl(AddPresetCommand command)
        {
            var preset = this.CurrentWorkspace.AddPreset(command.PresetStateName, command.PresetStateDescription, command.ModelGuids);

            CurrentWorkspace.RecordCreatedModel(preset);
        }
Example #3
0
        void CreatePresetStateImpl(AddPresetCommand command)
        {
            var preset = this.CurrentWorkspace.AddPreset(command.PresetStateName,command.PresetStateDescription,command.ModelGuids);

            CurrentWorkspace.RecordCreatedModel(preset);
        }
Example #4
0
 void CreatePresetStateImpl(AddPresetCommand command)
 {
     this.CurrentWorkspace.AddPreset(command.PresetStateName,command.PresetStateDescription,command.ModelGuids);
 }
Example #5
0
 void CreatePresetStateImpl(AddPresetCommand command)
 {
     this.CurrentWorkspace.AddPreset(command.PresetStateName, command.PresetStateDescription, command.ModelGuids);
 }