Ejemplo n.º 1
0
        public void When_no_participant_has_estimated_then_round_status_has_no_estimates()
        {
            var round = new EstimationRound();

            Participant.In(round, "nonEstimator");

            Assert.That(round.Status, Is.EquivalentTo(new[] { NoEstimate("nonEstimator") }), "estimates");
        }
Ejemplo n.º 2
0
        public void Named_participant_can_join_estimation_round()
        {
            var participant = new Participant("name");
            var round       = new EstimationRound();

            participant.Participate(round);

            Assert.That(round.Partipants, Is.EquivalentTo(new[] { participant }), "participants");
        }
Ejemplo n.º 3
0
        public void Cannot_join_estimation_round_when_same_name_is_already_participating()
        {
            var joe             = new Participant("joe");
            var againJoe        = new Participant("joe");
            var estimationRound = new EstimationRound();

            joe.Participate(estimationRound);
            Assert.Throws <ParticipantAlreadyParticpatesInRoundException>(() => againJoe.Participate(estimationRound));
        }
Ejemplo n.º 4
0
        public void When_all_participants_have_estimated_then_estimate_cannot_be_changed()
        {
            var round = new EstimationRound();
            var joe   = Participant.In(round, "joe");

            joe.Estimate(StoryPoints.Zero);

            Assert.Throws <CannotEstimateWhenAllEstimatesAreGivenException>(() => joe.Estimate(StoryPoints.One));
        }
Ejemplo n.º 5
0
        public void Estimate_by_participant_is_registered_in_estimation_round()
        {
            var round       = new EstimationRound();
            var participant = Participant.In(round);

            participant.Estimate(StoryPoints.Eight);

            Assert.That(round.Estimates[participant.Name], Is.EqualTo(StoryPoints.Eight));
        }
Ejemplo n.º 6
0
        public void When_single_participant_has_estimated_then_round_status_has_single_estimate()
        {
            var round     = new EstimationRound();
            var estimator = Participant.In(round, "estimator");

            estimator.Estimate(StoryPoints.Three);

            Assert.That(round.Status, Is.EquivalentTo(new[] { new Estimate("estimator", StoryPoints.Three) }), "estimates");
        }
Ejemplo n.º 7
0
        public void Multiple_participants_can_join_the_same_estimation_round()
        {
            var joe             = new Participant("joe");
            var jane            = new Participant("jane");
            var estimationRound = new EstimationRound();

            joe.Participate(estimationRound);
            jane.Participate(estimationRound);

            Assert.That(estimationRound.Partipants, Is.EquivalentTo(new[] { joe, jane }), "participants");
        }
Ejemplo n.º 8
0
        public void When_one_participant_has_estimated_and_another_has_not_then_round_status_has_two_estimates()
        {
            var round     = new EstimationRound();
            var estimator = Participant.In(round, "estimator");

            Participant.In(round, "nonEstimator");

            estimator.Estimate(StoryPoints.Three);

            Assert.That(round.Status, Is.EquivalentTo(new[] { new Estimate("estimator", StoryPoints.Three), NoEstimate("nonEstimator") }), "estimates");
        }
Ejemplo n.º 9
0
        public void When_participant_reestimates_then_previous_estimate_is_overwritten()
        {
            var round = new EstimationRound();
            var joe   = Participant.In(round, "joe");

            Participant.In(round, "jane");

            joe.Estimate(StoryPoints.Zero);
            joe.Estimate(StoryPoints.One);

            Assert.That(round.Estimates[joe.Name], Is.EqualTo(StoryPoints.One), "estimate of joe");
        }
Ejemplo n.º 10
0
        public void Estimates_by_multiple_participants_are_registered_in_estimation_round()
        {
            var round = new EstimationRound();
            var joe   = Participant.In(round, "joe");
            var jane  = Participant.In(round, "jane");

            joe.Estimate(StoryPoints.Three);
            jane.Estimate(StoryPoints.Five);

            Assert.That(round.Estimates[joe.Name], Is.EqualTo(StoryPoints.Three));
            Assert.That(round.Estimates[jane.Name], Is.EqualTo(StoryPoints.Five));
        }
Ejemplo n.º 11
0
        public void When_one_participant_has_estimated_and_another_has_not_then_round_status_has_1_estimate_and_2_participants()
        {
            var round     = new EstimationRound();
            var estimator = Participant.In(round, "estimator");

            Participant.In(round, "nonEstimator");
            estimator.Estimate(StoryPoints.Three);

            Assert.That(round.Status.EstimateCount, Is.EqualTo(1), "number of estimates");
            Assert.That(round.Status.ParticipantCount, Is.EqualTo(2), "number of participants");
            Assert.That(round.Status.IsCompleted, Is.False, "round completed");
        }
Ejemplo n.º 12
0
        public void Can_estimate_when_participating_in_estimation_round()
        {
            var      round       = new EstimationRound();
            Estimate estimate    = null;
            var      participant = Participant.In(round, "name");

            participant.Estimated += (sender, args) => estimate = args.Estimate;

            participant.Estimate(StoryPoints.Five);

            Assert.That(estimate.ParticipantName, Is.EqualTo("name"), "participant");
            Assert.That(estimate.StoryPoints, Is.EqualTo(StoryPoints.Five), "storypoints");
        }
Ejemplo n.º 13
0
        public void When_all_participants_have_estimated_then_estimation_round_notifies_all_participants_have_estimated()
        {
            var round     = new EstimationRound();
            var estimator = Participant.In(round, "estimator");
            RoundCompletedArgs completed = null;

            round.Completed += (sender, args) => completed = args;

            estimator.Estimate(StoryPoints.Coffee);

            Assert.That(completed, Is.Not.Null, "completed event");
            Assert.That(completed.Status, Is.Not.Null, "completed event status");
            Assert.That(round.Status.IsCompleted, Is.True, "round completed");
        }