Пример #1
0
        public void RandomString_Generates_Random_String_To_Length()
        {
            const int length = 20;

            var result = _sut.RandomString(length);

            Assert.Equal(length, result.Length);
        }
Пример #2
0
        private static void RandomizeTestBase <T, TKey>(T entity)
            where T : BaseTestEntity <TKey>, new()
        {
            if (entity.Decimal == 0)
            {
                entity.Decimal = _rand.RandomDecimal();
            }

            if (string.IsNullOrEmpty(entity.Name))
            {
                entity.Name = _rand.RandomString();
            }

            if (entity.Integer == 0)
            {
                entity.Integer = _rand.RandomInt();
            }
        }