public void SeedData()
        {
            var member1  = new FakeMember("Member1");
            var member2  = new FakeMember("Member2");
            var member3  = new FakeMember("Member3");
            var team1    = new FakeTeam("Team1");
            var team2    = new FakeTeam("Team2");
            var board1   = new FakeBoard("Board1");
            var board2   = new FakeBoard("Board2");
            var board3   = new FakeBoard("Board3");
            var feedback = new FakeFeedback("1");
            var story    = new FakeStory("2");

            database.AddTeamToDB(team1);
            database.AddTeamToDB(team2);
            database.AddMemberToDB(member1);
            database.AddMemberToDB(member2);
            database.AddMemberToDB(member3);
            database.AddWorkItemToDB(feedback);
            database.AddWorkItemToDB(story);

            team2.AddMember(member1);
            team1.AddBoard(board1);
            team2.AddBoard(board2);
            team2.AddBoard(board3);
            board1.AddWorkItem(feedback);
            board2.AddWorkItem(story);
            member1.AddWorkItems(story);
            member1.AddWorkItems(feedback);
        }
Esempio n. 2
0
        public void ShowTeamActivity_ShowMemberAndBoardActivity()
        {
            var           factory = new Mock <IFactory>();
            StringBuilder sb      = new StringBuilder();
            var           team    = new FakeTeam("Team5");

            database.AddTeamToDB(team);
            var board = new FakeBoard();

            team.AddBoard(board);
            var f1 = new FakeFeedback("5");

            board.AddWorkItem(f1);
            var f2 = new FakeFeedback("6");

            board.AddWorkItem(f2);
            var member = new FakeMember("Member5");

            database.AddMemberToDB(member);
            team.AddMember(member);
            var f3 = new FakeFeedback("7");

            member.AddWorkItems(f3);

            sb.AppendLine($"Team: 'Team5' - Boards activity: ");
            var activityTeam = team.Boards.SelectMany(b => b.ActivityHistory).ToList();

            sb.AppendLine(string.Join("; ", activityTeam));

            sb.AppendLine($"Team: 'Team5' - Members activity: ");
            var activityMembers = team.Members.SelectMany(m => m.ActivityHistory).ToList();

            sb.AppendLine(string.Join("; ", activityMembers));

            var result = new ShowTeamActivityCommand(new List <string>()
            {
                "Team5"
            }, database, factory.Object).Execute();

            Assert.AreEqual(sb.ToString(), result);
        }