コード例 #1
0
        public async Task StringBasicMethod_ExecuteAsync_ShouldReturnStringValues()
        {
            int numberToReturn = 2;
            int length = _random.Next(1, 20);
            CharactersAllowed charactersAllowed = CharactersAllowed.AlphaNumeric;
            const bool allowDuplicates = false;

            var target = new StringBasicMethod(_advisoryDelayHandler);
            var results = await target.GenerateStringsAsync(numberToReturn, length, charactersAllowed, allowDuplicates);

            TestResults(results.ToList(), numberToReturn, length,
                "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");
        }
コード例 #2
0
        public void StringBasicMethod_Execute_ShouldReteurnStringValues()
        {
            // Arrange
            BaseMethodTest bmt = new BaseMethodTest();
            int numberToReturn = 2;
            int length = bmt.Random.Next(1, 20);
            CharactersAllowed charactersAllowed = CharactersAllowed.AlphaNumeric;
            const bool allowDuplicates = false;

            // Act
            var target = new StringBasicMethod(bmt.AdvisoryDelayHandler, bmt.Service);
            var results = target.GenerateStrings(numberToReturn, length, charactersAllowed, allowDuplicates);

            // Assert
            TestResults(results.ToList(), numberToReturn, length,
                "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");
        }