コード例 #1
0
        public void FillInt16Array_ShouldProduceDesiredResults_ForUnboundedInvocation()
        {
            // Arrange.
            var arrayLength = 30;
            var array       = new Int16[arrayLength];

            using (var randomNumberGenerator = RandomNumberGenerator.Create())
            {
                // Act.
                randomNumberGenerator.FillInt16Array(array);

                // Assert.
                array.Length.Should().Be(arrayLength);
                array.GroupBy(value => value).Any(group => group.Count() > 4).Should().BeFalse();
            }
        }