示例#1
0
 public ProductBacklogItem(
     TenantId tenantId,
     ProductId productId,
     BacklogItemId backlogItem,
     int ordering)
 {
     this.BacklogItemId = backlogItem;
     this.Ordering      = ordering;
     this.ProductId     = productId;
     this.TenantId      = tenantId;
 }
 public void ReOrderFrom(BacklogItemId id, int orderOfPriority)
 {
     if (this.BacklogItemId.Equals(id))
     {
         this.Ordering = orderOfPriority;
     }
     else if (this.Ordering >= orderOfPriority)
     {
         this.Ordering = this.Ordering + 1;
     }
 }
示例#3
0
 internal void ReorderFrom(BacklogItemId id, int ordering)
 {
     if (BacklogItemId.Equals(id))
     {
         Ordering = ordering;
     }
     else if (Ordering >= ordering)
     {
         Ordering = Ordering + 1;
     }
 }
示例#4
0
 public ProductBacklogItem(
     TenantId tenantId,
     ProductId productId,
     BacklogItemId backlogItem,
     int ordering)
 {
     BacklogItemId = backlogItem;
     Ordering      = ordering;
     ProductId     = productId;
     TenantId      = tenantId;
 }
示例#5
0
        public void TestEntityIdentityEquality()
        {
            var guid = Guid.NewGuid();

            var id0 = new BacklogItemId(guid);
            var id1 = new BacklogItemId(guid);

            Assert.True(id0.Equals(id1));
            Assert.Equal(id0, id1);
            Assert.True(id0 == id1);
            Assert.False(id0 != id1);
        }
示例#6
0
        public TaskDefined(Tenants.TenantId tenantId, BacklogItemId backlogItemId, TaskId taskId, string volunteerMemberId, string name, string description)
        {
            TenantId      = tenantId;
            EventVersion  = 1;
            OccurredOn    = DateTime.UtcNow;
            BacklogItemId = backlogItemId;

            TaskId            = taskId;
            VolunteerMemberId = volunteerMemberId;
            Name        = name;
            Description = description;
        }
示例#7
0
        public void ESAggregateA_Applies_Domain_Events()
        {
            var id = new BacklogItemId();

            var item = BacklogItem.FromSummary(id, "summary");

            Assert.Equal(id, item.Id);
            Assert.Equal("summary", item.Summary);
            Assert.Equal(0, item.Version);

            Assert.Contains(item.DomainEvents, e => e is BacklogItemCreated);
        }
示例#8
0
        public void IdsAreEqual()
        {
            var guid = Guid.NewGuid();

            var id0 = new BacklogItemId(guid);
            var id1 = new BacklogItemId(guid);

            Assert.True(id0.Equals(id1));
            Assert.Equal(id0, id1);
            Assert.True(id0 == id1);
            Assert.False(id0 != id1);
        }
示例#9
0
        public void EntitiesWithSameIdentityAndProps_ShouldBeEqual()
        {
            var guid = Guid.NewGuid();

            var id = new BacklogItemId(guid);

            var item0 = BacklogItem.FromSummary(id, "item summary");
            var item1 = BacklogItem.FromSummary(id, "item summary");

            Assert.True(item0.Equals(item1));
            Assert.Equal(item0, item1);
            Assert.True(item0 == item1);
        }
        public bool Equals(CommittedBacklogItem other)
        {
            if (ReferenceEquals(this, other))
            {
                return(true);
            }
            if (ReferenceEquals(null, other))
            {
                return(false);
            }

            return(TenantId.Equals(other.TenantId) &&
                   SprintId.Equals(other.SprintId) &&
                   BacklogItemId.Equals(other.BacklogItemId));
        }
示例#11
0
        public bool Equals(ScheduledBacklogItem other)
        {
            if (ReferenceEquals(this, other))
            {
                return(true);
            }
            if (ReferenceEquals(null, other))
            {
                return(false);
            }

            return(TenantId.Equals(other.TenantId) &&
                   ReleaseId.Equals(other.ReleaseId) &&
                   BacklogItemId.Equals(other.BacklogItemId));
        }
示例#12
0
        public bool Equals(ProductBacklogItem other)
        {
            if (ReferenceEquals(this, other))
            {
                return(true);
            }
            if (ReferenceEquals(null, other))
            {
                return(false);
            }

            return(TenantId.Equals(other.TenantId) &&
                   ProductId.Equals(other.ProductId) &&
                   BacklogItemId.Equals(other.BacklogItemId));
        }
 public ProductBacklogItemPlanned(
     TenantId tenantId,
     ProductId productId,
     BacklogItemId backlogItemId,
     string summary,
     string category,
     BacklogItemType backlogItemType,
     StoryPoints storyPoints)
 {
     BacklogItemId = backlogItemId;
     Category      = category;
     EventVersion  = 1;
     OccurredOn    = DateTime.Now;
     ProductId     = productId;
     StoryPoints   = storyPoints;
     Summary       = summary;
     TenantId      = tenantId;
     Type          = backlogItemType;
 }
 public ProductBacklogItemPlanned(
     TenantId tenantId,
     ProductId productId,
     BacklogItemId backlogItemId,
     string summary,
     string category,
     BacklogItems.BacklogItemType backlogItemType,
     BacklogItems.StoryPoints storyPoints)
 {
     this.BacklogItemId = backlogItemId;
     this.Category      = category;
     this.EventVersion  = 1;
     this.OccurredOn    = DateTime.Now;
     this.ProductId     = productId;
     this.StoryPoints   = storyPoints;
     this.Summary       = summary;
     this.TenantId      = tenantId;
     this.Type          = backlogItemType;
 }
 public ProductBacklogItemPlanned(
     TenantId tenantId,
     ProductId productId,
     BacklogItemId backlogItemId,
     string summary,
     string category,
     BacklogItems.BacklogItemType backlogItemType,
     BacklogItems.StoryPoints storyPoints)
 {
     this.BacklogItemId = backlogItemId;
     this.Category = category;
     this.EventVersion = 1;
     this.OccurredOn = DateTime.Now;
     this.ProductId = productId;
     this.StoryPoints = storyPoints;
     this.Summary = summary;
     this.TenantId = tenantId;
     this.Type = backlogItemType;
 }
示例#16
0
 public BacklogItem(
     TenantId tenantId,
     ProductId productId,
     BacklogItemId backlogItemId,
     string summary,
     string category,
     BacklogItemType type,
     BacklogItemStatus backlogItemStatus,
     StoryPoints storyPoints)
 {
     this.BacklogItemId = backlogItemId;
     this.Category = category;
     this.ProductId = productId;
     this.Status = backlogItemStatus;
     this.StoryPoints = storyPoints;
     this.Summary = summary;
     this.TenantId = tenantId;
     this.Type = type;
 }
示例#17
0
 public Task(
     TenantId tenantId,
     BacklogItemId backlogItemId,
     TaskId taskId,
     TeamMember teamMember,
     string name,
     string description,
     int hoursRemaining,
     TaskStatus status)
 {
     TenantId       = tenantId;
     BacklogItemId  = backlogItemId;
     TaskId         = taskId;
     Volunteer      = teamMember.TeamMemberId;
     Name           = name;
     Description    = description;
     HoursRemaining = hoursRemaining;
     Status         = status;
     _estimationLog = new List <EstimationLogEntry>();
 }
示例#18
0
 public Task(
     TenantId tenantId, 
     BacklogItemId backlogItemId, 
     TaskId taskId, 
     TeamMember teamMember, 
     string name, 
     string description, 
     int hoursRemaining, 
     TaskStatus status)
 {
     this.TenantId = tenantId;
     this.BacklogItemId = backlogItemId;
     this.TaskId = taskId;
     this.Volunteer = teamMember.TeamMemberId;
     this.Name = name;
     this.Description = description;
     this.HoursRemaining = hoursRemaining;
     this.Status = status;
     this.estimationLog = new List<EstimationLogEntry>();
 }
示例#19
0
 public void ReorderFrom(BacklogItemId id, int ordering)
 {
     foreach (ProductBacklogItem productBacklogItem in this.BacklogItems)
     {
         productBacklogItem.ReorderFrom(id, ordering);
     }
 }
示例#20
0
        public BacklogItems.BacklogItem PlanBacklogItem(
                BacklogItemId newBacklogItemId,
                String summary,
                String category,
                BacklogItemType type,
                StoryPoints storyPoints)
        {
            BacklogItems.BacklogItem backlogItem =
                new BacklogItems.BacklogItem(
                        this.TenantId,
                        this.ProductId,
                        newBacklogItemId,
                        summary,
                        category,
                        type,
                        BacklogItemStatus.Planned,
                        storyPoints);

            DomainEventPublisher
                .Instance
                .Publish(new ProductBacklogItemPlanned(
                        backlogItem.TenantId,
                        backlogItem.ProductId,
                        backlogItem.BacklogItemId,
                        backlogItem.Summary,
                        backlogItem.Category,
                        backlogItem.Type,
                        backlogItem.StoryPoints));

            return backlogItem;
        }
 public BacklogItemDiscussionRequested(Tenants.TenantId tenantId, ProductId productId, BacklogItemId backlogItemId, bool isRequested)
 {
     TenantId      = tenantId;
     EventVersion  = 1;
     OccurredOn    = DateTime.UtcNow;
     ProductId     = productId;
     BacklogItemId = backlogItemId;
     IsRequested   = isRequested;
 }