mirror of
https://github.com/rjNemo/ticket_manager
synced 2026-06-06 00:36:39 +00:00
projectModel tests + add/remove project API endpoints removed as they are usefull only internally. Project Progression behaviour updated.
This commit is contained in:
parent
aa802bc20e
commit
96716d8a50
2 changed files with 10 additions and 7 deletions
|
|
@ -80,8 +80,6 @@ namespace TicketManager.Models
|
|||
{
|
||||
var projectUsers = new List<Guid>
|
||||
(this.Assignments.Select(a => a.UserId));
|
||||
|
||||
|
||||
foreach (var user in usersToAdd)
|
||||
{
|
||||
Assignment newAssign = new Assignment
|
||||
|
|
@ -92,9 +90,7 @@ namespace TicketManager.Models
|
|||
UserId = user.Id
|
||||
};
|
||||
this.Assignments.Add(newAssign);
|
||||
// AddLogEntry(this, " joined the project.");
|
||||
}
|
||||
// return this.Assignments;
|
||||
}
|
||||
public void RemoveMembers(List<AppUser> membersToRemove)
|
||||
{
|
||||
|
|
@ -121,10 +117,9 @@ namespace TicketManager.Models
|
|||
{
|
||||
this.AddMembers(projectMembers);
|
||||
}
|
||||
|
||||
}
|
||||
public int GetMembersCount() => this.GetMembers().Count();
|
||||
public void GetTicketsCount() => this.Tickets.Count();
|
||||
// public int GetMembersCount() => this.GetMembers().Count();
|
||||
// public void GetTicketsCount() => this.Tickets.Count();
|
||||
public void GetTicketsUpdates()
|
||||
{ throw new NotImplementedException("Not Implemented"); }
|
||||
public void Close()
|
||||
|
|
|
|||
|
|
@ -105,5 +105,13 @@ namespace TicketManager.Tests
|
|||
var res = project.GetMembers().Count();
|
||||
Assert.Equal(1, res);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CloseProject_IsClosed()
|
||||
{
|
||||
Project project = new Project() { Status = Status.InProgress };
|
||||
project.Close();
|
||||
Assert.Equal(Status.Done, project.Status);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue