Esempio n. 1
0
        public Sprint ScheduleSprint(
                SprintId newSprintId,
                String name,
                String goals,
                DateTime begins,
                DateTime ends)
        {
            Sprint sprint =
                new Sprint(
                        this.TenantId,
                        this.ProductId,
                        newSprintId,
                        name,
                        goals,
                        begins,
                        ends);

            DomainEventPublisher
                .Instance
                .Publish(new ProductSprintScheduled(
                        sprint.TenantId,
                        sprint.ProductId,
                        sprint.SprintId,
                        sprint.Name,
                        sprint.Goals,
                        sprint.Begins,
                        sprint.Ends));

            return sprint;
        }
Esempio n. 2
0
        public void CommitTo(Sprint sprint)
        {
            AssertionConcern.AssertArgumentNotNull(sprint, "Sprint must not be null.");
            AssertionConcern.AssertArgumentEquals(sprint.TenantId, this.TenantId, "Sprint must be of same tenant.");
            AssertionConcern.AssertArgumentEquals(sprint.ProductId, this.ProductId, "Sprint must be of same product.");

            if (!this.IsScheduledForRelease)
                throw new InvalidOperationException("Must be scheduled for release to commit to sprint.");

            if (this.IsCommittedToSprint)
            {
                if (!sprint.SprintId.Equals(this.SprintId))
                {
                    UncommittFromSprint();
                }
            }

            ElevateStatusWith(BacklogItemStatus.Committed);

            this.SprintId = sprint.SprintId;

            DomainEventPublisher.Instance.Publish(
                new BacklogItemCommitted(this.TenantId, this.BacklogItemId, sprint.SprintId));
        }