public void PickRandomBombId_ShouldReturnABombIdPickedWithRandom()
        {
            // Given
            _random.Range(0, 3)
            .Returns(1);

            _deviceInfo.GetDeviceBombLanguage()
            .Returns(BombLanguage.None);

            _allBombs = new AllBombs(_random, _bombs, _deviceInfo);

            // When
            var randomBombId = _allBombs.PickRandomBombId(2);

            // Then
            Assert.That(randomBombId, Is.EqualTo("bomb2"));
        }
Exemple #2
0
 public AllBombs(IRandom random, IBomb[] bombs, IDeviceInfo deviceInfo)
 {
     _random = random;
     _bombs  = bombs
               .Where(bomb => bomb.Language == BombLanguage.None || bomb.Language == deviceInfo.GetDeviceBombLanguage())
               .ToArray();
 }