Esempio n. 1
0
        public async Task ProcessMessages_2xMemberEstimated_2Estimations()
        {
            var propertyChangedCounter = new PropertyChangedCounter();
            var scrumTeam = PlanningPokerData.GetScrumTeam();
            var target    = CreateController(propertyChangedCounter);
            await target.InitializeTeam(CreateTeamResult(scrumTeam), PlanningPokerData.MemberName);

            var message1 = new MemberMessage
            {
                Id     = 5,
                Type   = MessageType.MemberEstimated,
                Member = new TeamMember
                {
                    Type = PlanningPokerData.ScrumMasterType,
                    Name = PlanningPokerData.ScrumMasterName
                }
            };
            var message2 = new MemberMessage
            {
                Id     = 6,
                Type   = MessageType.MemberEstimated,
                Member = new TeamMember
                {
                    Type = PlanningPokerData.MemberType,
                    Name = PlanningPokerData.MemberName
                }
            };

            StartEstimation(target);
            target.ProcessMessages(new Message[] { message2, message1 });

            Assert.AreEqual(3, propertyChangedCounter.Count);
            Assert.AreEqual(6, target.LastMessageId);
            Assert.IsTrue(target.CanSelectEstimation);
            Assert.IsFalse(target.CanStartEstimation);
            Assert.IsFalse(target.CanCancelEstimation);
            PlanningPokerControllerTest.AssertNoObserverHasEstimated(target);

            var estimations = target.Estimations.ToList();

            Assert.AreEqual(2, estimations.Count);
            var estimation = estimations[0];

            Assert.AreEqual(PlanningPokerData.ScrumMasterName, estimation.MemberName);
            Assert.IsFalse(estimation.HasEstimation);
            estimation = estimations[1];
            Assert.AreEqual(PlanningPokerData.MemberName, estimation.MemberName);
            Assert.IsFalse(estimation.HasEstimation);

            Assert.IsTrue(target.ScrumMaster.HasEstimated);
            PlanningPokerControllerTest.AssertMemberHasEstimated(target, PlanningPokerData.MemberName, true);
        }
Esempio n. 2
0
        public async Task ProcessMessages_MemberEstimatedWithScrumMaster_1Estimation()
        {
            var propertyChangedCounter = new PropertyChangedCounter();
            var scrumTeam = PlanningPokerData.GetScrumTeam();
            var target    = CreateController(propertyChangedCounter);
            await target.InitializeTeam(CreateTeamResult(scrumTeam), PlanningPokerData.ObserverName);

            var message = new MemberMessage
            {
                Id     = 4,
                Type   = MessageType.MemberEstimated,
                Member = new TeamMember
                {
                    Type = PlanningPokerData.ScrumMasterType,
                    Name = PlanningPokerData.ScrumMasterName
                }
            };

            StartEstimation(target);
            ProcessMessage(target, message);

            Assert.AreEqual(2, propertyChangedCounter.Count);
            Assert.AreEqual(4, target.LastMessageId);
            Assert.IsFalse(target.CanSelectEstimation);
            Assert.IsFalse(target.CanStartEstimation);
            Assert.IsFalse(target.CanCancelEstimation);
            PlanningPokerControllerTest.AssertNoObserverHasEstimated(target);

            Assert.AreEqual(1, target.Estimations.Count());
            var estimation = target.Estimations.First();

            Assert.AreEqual(PlanningPokerData.ScrumMasterName, estimation.MemberName);
            Assert.IsFalse(estimation.HasEstimation);

            Assert.IsTrue(target.ScrumMaster.HasEstimated);
            PlanningPokerControllerTest.AssertMemberHasEstimated(target, PlanningPokerData.MemberName, false);
        }