Ejemplo n.º 1
0
        public IEnumerable <TTestCase> OrderTestCases <TTestCase>(IEnumerable <TTestCase> testCases) where TTestCase : ITestCase
        {
            var testFiles      = testCases.Select(t => t.TestMethodArguments[0].ToString()).ToList();
            var importRequests = testFiles.Select(file => new ImportOPCModel {
                FileName = Path.Combine(IntegrationTests.strTestNodeSetDirectory, file), Data = File.ReadAllText(file),
            }).ToList();
            var orderedImportRequests = IntegrationTests.OrderImportsByDependencies(importRequests);
            var testCaseList          = testCases.ToList();
            var orderedTestCases      = orderedImportRequests.Select(ir => testCaseList.FirstOrDefault(tc => tc.TestMethodArguments[0].ToString() == ir.FileName)).ToList();

            return(orderedTestCases);
        }
Ejemplo n.º 2
0
        internal static string[] GetFiles()
        {
            var nodeSetFiles = Directory.GetFiles(IntegrationTests.strTestNodeSetDirectory);

            var importRequest = new List <MyNamespace.ImportOPCModel>();

            foreach (var file in nodeSetFiles)
            {
                importRequest.Add(new ImportOPCModel {
                    FileName = Path.GetFileName(file), Data = File.ReadAllText(file),
                });
            }
            var orderedImportRequest = IntegrationTests.OrderImportsByDependencies(importRequest);
            var orderedNodeSetFiles  = orderedImportRequest.Select(r => r.FileName).ToArray();

            return(orderedNodeSetFiles);
        }