public void Handle(UserGroupChangedEvent receivedEvent)
 {
     if (receivedEvent.IsNew)
     {
         View.SelectItemInTreeView(BindingModel.AddUserGroup(receivedEvent.Id, receivedEvent.Name, receivedEvent.ParentId));
     }
     else
     {
         BindingModel.UpdateUserGroup(receivedEvent.Id, receivedEvent.Name, receivedEvent.ParentId);
     }
 }
Ejemplo n.º 2
0
		public void AddUserGroup_WithParent_IsAddedAsChildOfParent()
		{
			var newId = Guid.NewGuid();
			BindingModel.AddUserGroup(newId, "blah", thirdLevel1.Id);
			Assert.AreEqual(newId, BindingModel.UserGroups[1].Children[1].Children[0].Children[0].Id);
		}
Ejemplo n.º 3
0
		public void AddUserGroup_WithoutParent_IsAddedAsRoot()
		{
			var newId = Guid.NewGuid();
			BindingModel.AddUserGroup(newId, "blah");
			Assert.IsTrue(BindingModel.UserGroups.Any(u => u.Id == newId));
		}