projectModel tests + add/remove project API endpoints removed as they are usefull only internally. Project Progression behaviour updated.

This commit is contained in:
Ruidy Nemausat 2020-02-17 11:31:48 +01:00
parent aa802bc20e
commit 96716d8a50
2 changed files with 10 additions and 7 deletions

View file

@ -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()

View file

@ -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);
}
}
}