Ejemplo n.º 1
0
        public async Task PlanningPokerEstimatedWithObserver_ShowsEstimations()
        {
            var serviceProvider = CreateServiceProvider();
            var renderer        = serviceProvider.GetRequiredService <TestRenderer>();
            var controller      = serviceProvider.GetRequiredService <PlanningPokerController>();

            var reconnectResult = PlanningPokerData.GetReconnectTeamResult();

            reconnectResult.ScrumTeam.State            = TeamState.EstimationFinished;
            reconnectResult.ScrumTeam.EstimationResult = new List <EstimationResultItem>
            {
                new EstimationResultItem
                {
                    Member = new TeamMember {
                        Type = PlanningPokerData.ScrumMasterType, Name = PlanningPokerData.ScrumMasterName
                    },
                    Estimation = new Estimation {
                        Value = 8
                    }
                },
                new EstimationResultItem
                {
                    Member = new TeamMember {
                        Type = PlanningPokerData.MemberType, Name = PlanningPokerData.MemberName
                    },
                    Estimation = new Estimation {
                        Value = 3
                    }
                }
            };
            await controller.InitializeTeam(reconnectResult, PlanningPokerData.ObserverName);

            var target = renderer.InstantiateComponent <PlanningPokerDesk>();

            var componentId = renderer.AssignRootComponentId(target);
            await renderer.RenderRootComponentAsync(componentId);

            Assert.AreEqual(1, renderer.Batches.Count);
            var frames = renderer.Batches[0].ReferenceFrames;

            Assert.AreEqual(57, frames.Count);

            // Team name and user name
            AssertFrame.Element(frames[0], "div", 57);
            AssertFrame.Attribute(frames[1], "class", "pokerDeskPanel");
            AssertFrame.Element(frames[3], "div", 17);
            AssertFrame.Attribute(frames[4], "class", "team-title");
            AssertFrame.Element(frames[6], "h2", 6);
            AssertFrame.Markup(frames[8], $"<span class=\"badge badge-secondary\"><span class=\"oi oi-people\" title=\"Team\" aria-hidden=\"true\"></span></span>{_newLine}            ");
            AssertFrame.Element(frames[9], "span", 2);
            AssertFrame.Text(frames[10], PlanningPokerData.TeamName);
            AssertFrame.Element(frames[13], "h3", 6);
            AssertFrame.Markup(frames[15], $"<span class=\"badge badge-secondary\"><span class=\"oi oi-person\" title=\"User\" aria-hidden=\"true\"></span></span>{_newLine}            ");
            AssertFrame.Element(frames[16], "span", 2);
            AssertFrame.Text(frames[17], PlanningPokerData.ObserverName);

            // Estimations
            AssertFrame.Element(frames[24], "div", 32);
            AssertFrame.Attribute(frames[25], "class", "estimationResult");
            AssertFrame.Markup(frames[27], $"<h3>Selected estimates</h3>{_newLine}            ");
            AssertFrame.Element(frames[28], "ul", 27);
            AssertSelectedEstimation(frames, 31, PlanningPokerData.MemberName, "3");
            AssertSelectedEstimation(frames, 43, PlanningPokerData.ScrumMasterName, "8");
        }
Ejemplo n.º 2
0
        public async Task PlanningPokerStartedWithMember_ShowsAvailableEstimations()
        {
            var serviceProvider = CreateServiceProvider();
            var renderer        = serviceProvider.GetRequiredService <TestRenderer>();
            var controller      = serviceProvider.GetRequiredService <PlanningPokerController>();

            var reconnectResult = PlanningPokerData.GetReconnectTeamResult();

            reconnectResult.ScrumTeam.State = TeamState.EstimationInProgress;
            reconnectResult.ScrumTeam.EstimationParticipants = new List <EstimationParticipantStatus>
            {
                new EstimationParticipantStatus()
                {
                    MemberName = PlanningPokerData.ScrumMasterName, Estimated = true
                },
                new EstimationParticipantStatus()
                {
                    MemberName = PlanningPokerData.MemberName, Estimated = false
                }
            };
            await controller.InitializeTeam(reconnectResult, PlanningPokerData.MemberName);

            var target = renderer.InstantiateComponent <PlanningPokerDesk>();

            var componentId = renderer.AssignRootComponentId(target);
            await renderer.RenderRootComponentAsync(componentId);

            Assert.AreEqual(1, renderer.Batches.Count);
            var frames = renderer.Batches[0].ReferenceFrames;

            Assert.AreEqual(133, frames.Count);

            // Team name and user name
            AssertFrame.Element(frames[0], "div", 133);
            AssertFrame.Attribute(frames[1], "class", "pokerDeskPanel");
            AssertFrame.Element(frames[3], "div", 17);
            AssertFrame.Attribute(frames[4], "class", "team-title");
            AssertFrame.Element(frames[6], "h2", 6);
            AssertFrame.Markup(frames[8], $"<span class=\"badge badge-secondary\"><span class=\"oi oi-people\" title=\"Team\" aria-hidden=\"true\"></span></span>{_newLine}            ");
            AssertFrame.Element(frames[9], "span", 2);
            AssertFrame.Text(frames[10], PlanningPokerData.TeamName);
            AssertFrame.Element(frames[13], "h3", 6);
            AssertFrame.Markup(frames[15], $"<span class=\"badge badge-secondary\"><span class=\"oi oi-person\" title=\"User\" aria-hidden=\"true\"></span></span>{_newLine}            ");
            AssertFrame.Element(frames[16], "span", 2);
            AssertFrame.Text(frames[17], PlanningPokerData.MemberName);

            // Available estimations
            AssertFrame.Element(frames[22], "div", 86);
            AssertFrame.Attribute(frames[23], "class", "availableEstimations");
            AssertFrame.Markup(frames[25], $"<h3>Pick estimation</h3>{_newLine}            ");
            AssertFrame.Element(frames[26], "ul", 81);
            AssertAvailableEstimation(frames, 29, "0");
            AssertAvailableEstimation(frames, 35, "½");
            AssertAvailableEstimation(frames, 41, "1");
            AssertAvailableEstimation(frames, 47, "2");
            AssertAvailableEstimation(frames, 53, "3");
            AssertAvailableEstimation(frames, 59, "5");
            AssertAvailableEstimation(frames, 65, "8");
            AssertAvailableEstimation(frames, 71, "13");
            AssertAvailableEstimation(frames, 77, "20");
            AssertAvailableEstimation(frames, 83, "40");
            AssertAvailableEstimation(frames, 89, "100");
            AssertAvailableEstimation(frames, 95, "∞");
            AssertAvailableEstimation(frames, 101, "?");

            // Members, who estimated already
            AssertFrame.Element(frames[112], "div", 20);
            AssertFrame.Attribute(frames[113], "class", "estimationResult");
            AssertFrame.Markup(frames[115], $"<h3>Selected estimates</h3>{_newLine}            ");
            AssertFrame.Element(frames[116], "ul", 15);
            AssertSelectedEstimation(frames, 119, PlanningPokerData.ScrumMasterName, string.Empty);
        }
Ejemplo n.º 3
0
 public static void Attribute(RenderTreeFrame frame, string attributeName, string attributeValue, int?sequence = null)
 {
     AssertFrame.Attribute(frame, attributeName, sequence);
     Assert.AreEqual(attributeValue, frame.AttributeValue);
 }