Example #1
0
        private static IList <TestOperation> GenerateOperations(int count, ICollection <Type> blackList)
        {
            var generatedOperations = new List <TestOperation>();
            var generator           = new RandomOperationGenerator();

            for (var i = 0; i < count;)
            {
                var operation = generator.NextOperation();
                if (blackList.Contains(operation.GetType()))
                {
                    continue;
                }
                generatedOperations.Add(operation);
                ++i;
            }

            return(generatedOperations);
        }
Example #2
0
        public void Random_20RandomOperations_ExecutedCorrectly(string clipTitle)
        {
            RunPlayerTest(clipTitle, async context =>
            {
                context.RandomMaxDelayTime = TimeSpan.FromSeconds(3);
                context.DelayTime          = TimeSpan.FromSeconds(2);

                var generator = new RandomOperationGenerator();
                for (var i = 0; i < 20; i++)
                {
                    TestOperation operation;
                    do
                    {
                        operation = generator.NextOperation();
                    } while (operation.GetType() == typeof(StopOperation) ||
                             operation.GetType() == typeof(PrepareOperation));

                    await operation.Execute(context);
                }
            });
        }