Exemple #1
0
        IEnumerable <TTestCase> ITestCaseOrderer.OrderTestCases <TTestCase>(IEnumerable <TTestCase> testCases)
        {
            Dictionary <int, List <TTestCase> > queue = new Dictionary <int, List <TTestCase> >();

            foreach (TTestCase testCase in testCases)
            {
                Xunit.Abstractions.IAttributeInfo orderAttribute = ReflectionAbstractionExtensions.GetCustomAttributes(testCase.TestMethod.Method, typeof(TestOrderAttribute)).FirstOrDefault();
                int order;
                if (orderAttribute == null || (order = orderAttribute.GetConstructorArguments().Cast <int>().First()) == 0)
                {
                    yield return(testCase);
                }
                else
                {
                    List <TTestCase> batch;
                    if (!queue.TryGetValue(order, out batch))
                    {
                        queue.Add(order, batch = new List <TTestCase>());
                    }
                    batch.Add(testCase);
                }
            }
            foreach (var order in queue.Keys.OrderBy(i => i))
            {
                foreach (var testCase in queue[order])
                {
                    yield return(testCase);
                }
            }
        }
 protected override string GetSkipReason(Xunit.Abstractions.IAttributeInfo factAttribute)
 {
     throw null;
 }
 public System.Collections.Generic.IEnumerable <System.Collections.Generic.KeyValuePair <string, string> > GetTraits(Xunit.Abstractions.IAttributeInfo traitAttribute)
 {
     throw null;
 }