Beispiel #1
0
        public void DisconnectInactiveObservers_EstimationStartedActiveScrumMasterInactiveMember_ScrumMasterGetsEstimationResult()
        {
            // Arrange
            var dateTimeProvider = new DateTimeProviderMock();

            dateTimeProvider.SetUtcNow(new DateTime(2012, 1, 1, 3, 2, 20));

            var target = new ScrumTeam("test team", dateTimeProvider);
            var master = target.SetScrumMaster("master");
            var member = (Member)target.Join("member", false);

            master.StartEstimation();

            dateTimeProvider.SetUtcNow(new DateTime(2012, 1, 1, 3, 2, 30));
            master.Estimation = new Estimation();
            master.UpdateActivity();

            dateTimeProvider.SetUtcNow(new DateTime(2012, 1, 1, 3, 2, 55));
            TestHelper.ClearMessages(master);

            // Act
            target.DisconnectInactiveObservers(TimeSpan.FromSeconds(30.0));

            // Verify
            Assert.AreEqual <TeamState>(TeamState.EstimationFinished, target.State);
            Assert.IsNotNull(target.EstimationResult);

            Assert.IsTrue(master.HasMessage);
            master.PopMessage();
            Assert.IsTrue(master.HasMessage);
            var message = master.PopMessage();

            Assert.AreEqual <MessageType>(MessageType.EstimationEnded, message.MessageType);
        }
Beispiel #2
0
        public void DisconnectInactiveObservers_ActiveObserverAndInactiveMember_ObserverMessageReceived()
        {
            // Arrange
            var dateTimeProvider = new DateTimeProviderMock();

            dateTimeProvider.SetUtcNow(new DateTime(2012, 1, 1, 3, 2, 20));

            var target = new ScrumTeam("test team", dateTimeProvider);
            var master = target.SetScrumMaster("master");
            var member = target.Join("member", false);

            dateTimeProvider.SetUtcNow(new DateTime(2012, 1, 1, 3, 2, 30));
            var       observer  = target.Join("observer", true);
            EventArgs eventArgs = null;

            observer.MessageReceived += new EventHandler((s, e) => eventArgs = e);

            dateTimeProvider.SetUtcNow(new DateTime(2012, 1, 1, 3, 2, 55));

            // Act
            target.DisconnectInactiveObservers(TimeSpan.FromSeconds(30.0));

            // Verify
            Assert.IsNotNull(eventArgs);
            Assert.IsTrue(observer.HasMessage);
            var message = observer.PopMessage();

            Assert.AreEqual <MessageType>(MessageType.MemberDisconnected, message.MessageType);
        }
Beispiel #3
0
        public void DisconnectInactiveObservers_InactiveObserver_ObserverIsDisconnected()
        {
            // Arrange
            var dateTimeProvider = new DateTimeProviderMock();

            dateTimeProvider.SetUtcNow(new DateTime(2012, 1, 1, 3, 2, 20));

            var name   = "test";
            var target = new ScrumTeam("test team", dateTimeProvider);

            target.Join(name, true);

            dateTimeProvider.SetUtcNow(new DateTime(2012, 1, 1, 3, 2, 55));

            // Act
            target.DisconnectInactiveObservers(TimeSpan.FromSeconds(30.0));

            // Verify
            Assert.AreEqual <int>(0, target.Observers.Count());
        }
Beispiel #4
0
        public void DisconnectInactiveObservers_NoInactiveMembers_TeamIsUnchanged()
        {
            // Arrange
            var dateTimeProvider = new DateTimeProviderMock();

            dateTimeProvider.SetUtcNow(new DateTime(2012, 1, 1, 3, 2, 20));

            var name   = "test";
            var target = new ScrumTeam("test team", dateTimeProvider);

            target.Join(name, false);

            dateTimeProvider.SetUtcNow(new DateTime(2012, 1, 1, 3, 2, 40));

            // Act
            target.DisconnectInactiveObservers(TimeSpan.FromSeconds(30.0));

            // Verify
            Assert.AreEqual <int>(1, target.Members.Count());
        }
Beispiel #5
0
 private bool VerifyTeamActive(ScrumTeam team)
 {
     team.DisconnectInactiveObservers(Configuration.ClientInactivityTimeout);
     return(IsTeamActive(team));
 }
 private bool VerifyTeamActive(ScrumTeam team)
 {
     team.DisconnectInactiveObservers(this.Configuration.ClientInactivityTimeout);
     return team.Members.Any() || team.Observers.Any();
 }