Example #1
0
        public void TestQuestionTwoSingle()
        {
            var output = new Question2TestOutput();

            using (var slowReader = new SlowCharacterReader())
            {
                DeveloperImplementation.RunQuestionTwo(new ICharacterReader[] { slowReader }, output);
                VerifyQuestionTwoSingle(output);
            }
        }
Example #2
0
        public async Task TestQuestionTwoSingleAsync()
        {
            var output = new Question2TestOutput();

            using (var slowReader = new SlowCharacterReader())
            {
                await DeveloperImplementation.RunQuestionTwo(new ICharacterReader[] { slowReader }, output, CancellationToken.None);

                VerifyQuestionTwoSingle(output);
            }
        }
        [Test, Timeout(220000)] // Timeout parameter value changed from 120000 to 220000 by Kostas.
        public async Task TestQuestionTwoMultipleAsync()
        {
            var output = new Question2TestOutput();

            using (var slowReader1 = new SlowCharacterReader())
                using (var slowReader2 = new SlowCharacterReader())
                    using (var slowReader3 = new SlowCharacterReader())
                    {
                        await DeveloperImplementation.RunQuestionTwo(new ICharacterReader[] { slowReader1, slowReader2, slowReader3 }, output);

                        VerifyQuestionTwoMultiple(output);
                    }
        }
Example #4
0
        private static async Task TestQuestionTwoWithSingleSlowCharacterReaderAsync(bool verbose)
        {
            DeveloperTestImplementationAsync test = new DeveloperTestImplementationAsync();

            var output = new Question2TestOutput();

            using (var slowReader = new SlowCharacterReader())
            {
                if (verbose)
                {
                    Console.WriteLine("TestQuestionTwoWithSingleSlowCharacterReaderAsync: started");
                    await test.RunQuestionTwo(new ICharacterReader[] { slowReader }, output);

                    Console.WriteLine("TestQuestionTwoWithSingleSlowCharacterReaderAsync: ended");
                }
                else
                {
                    await test.RunQuestionTwo(new ICharacterReader[] { slowReader }, output);
                }
            }
        }