public void AddMultiplyProjectBinding_AddedOnlyOneElement()
        {
            Distribution distribution = CreateDistribution();
            Project      project      = new Project(Guid.NewGuid(), "Rxxxxxxxx", "Rxxxxxxxx");
            string       versionMask  = "1.4.**";

            distribution.AddProjectBinding(new ProjectBinding(versionMask, project), null);
            distribution.AddProjectBinding(new ProjectBinding(versionMask, project), null);

            Assert.Equal(DistributionName, distribution.Name);
            Assert.NotEmpty(distribution.Owners);
            Assert.NotEmpty(distribution.AvailableLifeCycles);
            Assert.NotEmpty(distribution.LifeCycleStateRules);
            Assert.IsType <DistributionCreated>(distribution.GetUncommitedChanges().First());
            Assert.IsType <ProjectBindingAdded>(distribution.GetUncommitedChanges().Last());
            Assert.Equal(2, distribution.GetUncommitedChanges().Count);
            Assert.Single(distribution.ProjectBindings);
            Assert.Equal(project.Name, distribution.ProjectBindings[0].Project.Name);
            Assert.Equal(versionMask, distribution.ProjectBindings[0].MaskProjectVersion);
        }
        private void UpdateProjectBindings(UpdateDistribution command, Distribution distribution)
        {
            (IList <ProjectBinding> newBindings, IList <ProjectBinding> bindingsToDelete) =
                collectionsComparer
                .Compare(distribution.ProjectBindings, command.ProjectBindings);

            foreach (ProjectBinding binding in bindingsToDelete)
            {
                distribution.RemoveProjectBinding(binding, command.ActionUser.Sid);
            }

            foreach (ProjectBinding binding in newBindings)
            {
                distribution.AddProjectBinding(binding, command.ActionUser.Sid);
            }
        }