public void Test()
        {
            var results = new List <string>();

            for (int i = 0; i < 10; i++)
            {
                var session = new ScrumPokerSession(TestHelpers.GetTestUser(1), 1);
                session.AddUser(TestHelpers.GetTestUser(2));
                session.AddUser(TestHelpers.GetTestUser(3));
                session.AddUser(TestHelpers.GetTestUser(4));
                session.AddUser(TestHelpers.GetTestUser(5));
                session.AddUser(TestHelpers.GetTestUser(6));
                session.AddUser(TestHelpers.GetTestUser(7));
                session.AddUser(TestHelpers.GetTestUser(8));

                session.StartPoker();
                session.Estimate(TestHelpers.GetTestUser(1), 1);
                session.Estimate(TestHelpers.GetTestUser(2), 1);
                session.Estimate(TestHelpers.GetTestUser(3), 1);
                session.Estimate(TestHelpers.GetTestUser(4), 13);
                session.Estimate(TestHelpers.GetTestUser(5), 13);
                session.Estimate(TestHelpers.GetTestUser(6), 13);
                session.Estimate(TestHelpers.GetTestUser(7), 1);
                session.Estimate(TestHelpers.GetTestUser(8), 1);

                results.Add(session.Poker.ToString());
            }
        }
Exemple #2
0
 public void SendPokerResult(ScrumPokerSession session, string result)
 {
     foreach (var pokerUser in session.AllUsers)
     {
         bot.SendTextMessage(pokerUser.ChatId, result);
     }
 }
        private void CloseSession(ScrumPokerSession session)
        {
            var users = session.AllUsers.ToArray();

            messageSender.InformUserSessionEnded(users);
            ScrumPokerSessions.Remove(session.Id);
        }
        public int StartNewSession(PokerUser user)
        {
            var existingSession = GetSession(user);

            if (existingSession != null)
            {
                messageSender.UserAlreadyInSession(user);
                return(0);
            }
            var newSession = new ScrumPokerSession(user, idGenerator.GetId());

            ScrumPokerSessions.Add(newSession);
            messageSender.SendStartSessionToMaster(user, newSession.Id);
            return(newSession.Id);
        }
Exemple #5
0
 private static InlineKeyboardButton GetButton(ScrumPokerSession s)
 {
     return(new InlineKeyboardButton(string.Format(ConnectionText, s.MasterUser),
                                     string.Format(ConnectionData, s.Id, s.MasterUser)));
 }