void UngroupModelImpl(UngroupModelCommand command) { if (command.ModelGuid == Guid.Empty) { return; } var modelsToUngroup = command.ModelGuids.Select(guid => CurrentWorkspace.GetModelInternal(guid)).ToList(); UngroupModel(modelsToUngroup); }
void UngroupModelImpl(UngroupModelCommand command) { var modelsToUngroup = new List <ModelBase>(); if (command.ModelGuid != Guid.Empty) { modelsToUngroup.Add(CurrentWorkspace.GetModelInternal(command.ModelGuid)); } UngroupModel(modelsToUngroup); }
public void UngroupGrouplImplTest() { //Arrange var guid1 = Guid.Empty; var command1 = new AddModelToGroupCommand(guid1); var command2 = new UngroupModelCommand(guid1); //Act //Internally this will execute the AddToGroupImpl method command1.Execute(CurrentDynamoModel); //Internally this will execute the UngroupModelImpl method command2.Execute(CurrentDynamoModel); //Assert //Verify that the command was created successfully and that the guids match Assert.IsNotNull(command1); Assert.AreEqual(command1.ModelGuid, guid1); Assert.IsNotNull(command2); Assert.AreEqual(command2.ModelGuid, guid1); }
public void UngroupModelCommand_Constructors() { //Arrange var guid1 = Guid.NewGuid(); var guid2 = Guid.NewGuid(); XmlDocument xmlDocument = new XmlDocument(); //Act var command1 = new UngroupModelCommand(guid1.ToString()); var command2 = new UngroupModelCommand(guid2); var serializedCommand = command1.Serialize(xmlDocument); //Assert //Verify that the guid in the commands created are right Assert.IsNotNull(command1); Assert.AreEqual(command1.ModelGuid.ToString(), guid1.ToString()); Assert.IsNotNull(command2); Assert.AreEqual(command2.ModelGuid.ToString(), guid2.ToString()); Assert.IsNotNull(serializedCommand); }
void UngroupModelImpl(UngroupModelCommand command) { if (command.ModelGuid == Guid.Empty) return; var modelsToUngroup = command.ModelGuids.Select(guid => CurrentWorkspace.GetModelInternal(guid)).ToList(); UngroupModel(modelsToUngroup); }