public void IsCurrentAttemptDefuser_ShouldReturnFalse_WhenCurrentDefuseAttemptReturnFalse()
        {
            // Given
            var player = new Player("Player Name");

            _currentDefuseAttempt.IsDefuser(player).Returns(false);
            _defusingState.SetNewDefuseAttempt(_currentDefuseAttempt);

            // When
            var isCurrentAttemptDefuser = _defusingState.IsCurrentAttemptDefuser(player);

            // Then
            Assert.IsFalse(isCurrentAttemptDefuser);
        }
Esempio n. 2
0
 public virtual void Try(Player player)
 {
     if (_defusingState.IsCurrentAttemptDefuser(player))
     {
         _analyticsSubmitter.TrackBombDefused();
         _defusingState.IncrementBombsDefused();
         _defuseSucceededListener.OnDefuseSucceeded();
     }
     else
     {
         _analyticsSubmitter.TrackBombExploded();
         _defuseFailedListener.OnDefuseFailed(_defusingState.NbBombsDefused);
     }
 }
        public void Try_ShouldNotifyOnDefuseSucceededListener_WhenPlayerIsDefuser()
        {
            // Given
            var player = new Player("Player");

            _defusingState.IsCurrentAttemptDefuser(player)
            .Returns(true);

            // When
            _tryToDefuse.Try(player);

            // Then
            _defuseSucceededListener
            .Received()
            .OnDefuseSucceeded();
        }