示例#1
0
        public void GetInt_Has_Max_Upper_Bound()
        {
            // Arrange
            const int upperBound = 0;

            // Act
            var retrievedInt = Random.GetInt(upperBound);

            // Assert
            retrievedInt.Should().Be(upperBound);
        }
示例#2
0
        public void GetInt_Is_Within_Two_Bounds()
        {
            // Arrange
            const int lowerBound = 5;
            const int upperBound = 6;

            // Act
            var retrievedInt = Random.GetInt(lowerBound, upperBound);

            // Assert
            retrievedInt.Should().Be(lowerBound);
        }
        protected static IEnumerable <TestClass> GetTestObjects(int count)
        {
            IEnumerable <TestClass> ReturnFromStream()
            {
                while (true)
                {
                    yield return(new TestClass
                    {
                        GuidProp = Guid.NewGuid(),
                        IntProp = Random.GetInt(),
                        StringProp = Random.GetString(10)
                    });
                }
            }

            return(ReturnFromStream().Take(count).ToList());
        }