private static ProjectData SetTaskResourceNamesOrInitials(ProjectData project, TaskId id, string value, bool isInitials)
        {
            var field = isInitials ? ResourceFields.Initials : ResourceFields.Name;

            value = value.Trim();

            var remainingAssignmentIds = project.GetAssignments(id).ToList();

            if (value.Length > 0)
            {
                var resourceParts = value.Split(',');

                foreach (var resourcePart in resourceParts)
                {
                    var initials    = resourcePart.Trim();
                    var units       = 1.0;
                    var openBracket = initials.IndexOf("[");
                    if (openBracket >= 0)
                    {
                        var closeBracket = initials.IndexOf("]");

                        if (closeBracket < openBracket)
                        {
                            throw new FormatException("Missing ']'");
                        }

                        var percentageText = initials.Substring(openBracket + 1, closeBracket - openBracket - 1).Trim();

                        if (percentageText.EndsWith("%"))
                        {
                            percentageText = percentageText.Substring(0, percentageText.Length - 1).Trim();
                        }

                        if (!double.TryParse(percentageText, out var percentage))
                        {
                            throw new FormatException($"'{percentageText}' isn't a valid percentage");
                        }

                        initials = initials.Substring(0, openBracket).Trim();
                        units    = percentage / 100.0;
                    }

                    var resourceId = project.GetResources(initials, isInitials).FirstOrDefault();
                    if (resourceId.IsDefault)
                    {
                        resourceId = ResourceId.Create();
                        project    = project.AddResource(resourceId).Set(field, resourceId, initials);
                    }

                    var assignmentId = project.GetAssignment(id, resourceId);
                    if (assignmentId.IsDefault)
                    {
                        assignmentId = AssignmentId.Create();
                        project      = project.AddAssignment(assignmentId, id, resourceId);
                    }

                    project = project.Set(AssignmentFields.Units, assignmentId, units);
                    remainingAssignmentIds.Remove(assignmentId);
                }
            }

            foreach (var assignmentId in remainingAssignmentIds)
            {
                project = project.RemoveAssignment(assignmentId);
            }

            return(project);
        }