Ejemplo n.º 1
0
        static void Main(string[] _)
        {
            var info = AssemblyDefinition.ReadAssembly(Assembly.GetExecutingAssembly().Location).MainModule.GetType("JazSharp.ManualTest.Program").Methods;

            using (var testCollection = TestCollection.FromSources(new[] { @"C:\Users\seamillo\source\repos\JazSharp\JazSharp.Tests\bin\Debug\netcoreapp2.2\JazSharp.Tests.dll" }))
                using (var testRun = testCollection.CreateTestRun())
                {
                    var result = testRun.ExecuteAsync().Result;
                }
        }
Ejemplo n.º 2
0
        static void Main(string[] _)
        {
            var info = AssemblyDefinition.ReadAssembly(Assembly.GetExecutingAssembly().Location).MainModule.GetType("JazSharp.ManualTest.Program").Methods;

            using (var testCollection = TestCollection.FromSources(new[] { typeof(Program).Assembly.Location.Replace("ManualTest", "Tests") }))
                using (var testRun = testCollection.CreateTestRun())
                {
                    var result = testRun.ExecuteAsync().Result;
                }
        }
Ejemplo n.º 3
0
        public void DiscoverTests(IEnumerable <string> sources, IDiscoveryContext discoveryContext, IMessageLogger logger, ITestCaseDiscoverySink discoverySink)
        {
            Dispose();

            _testCollection = TestCollection.FromSources(sources);

            foreach (var test in _testCollection.Tests)
            {
                logger.SendMessage(TestMessageLevel.Informational, "Test found: " + test.FullName);
                discoverySink.SendTestCase(test.ToTestCase());
            }
        }
Ejemplo n.º 4
0
 public void RunTests(IEnumerable <string> sources, IRunContext runContext, IFrameworkHandle frameworkHandle)
 {
     try
     {
         var testCollection = TestCollection.FromSources(sources);
         ExecuteTestRun(testCollection, frameworkHandle, testCollection.Tests.ToDictionary(x => x, x => x.ToTestCase()));
     }
     catch (Exception ex)
     {
         File.WriteAllText("C:/Users/seamillo/Desktop/jazsharp.testadapter.log", ex.ToString());
         throw;
     }
 }
Ejemplo n.º 5
0
        public void RunTests(IEnumerable <TestCase> tests, IRunContext runContext, IFrameworkHandle frameworkHandle)
        {
            var testsList      = tests.ToList();
            var testCollection = TestCollection.FromSources(testsList.Select(x => x.Source).Distinct());

            var testMapping =
                new Dictionary <Test, TestCase>(
                    testCollection.Tests
                    .Select(x => new KeyValuePair <Test, TestCase>(x, testsList.FirstOrDefault(y => x.IsForTestCase(y))))
                    .Where(x => x.Value != null));

            testCollection.Filter(testMapping.ContainsKey);

            ExecuteTestRun(testCollection, frameworkHandle, testMapping);
        }
Ejemplo n.º 6
0
        public void RunTests(IEnumerable <TestCase> tests, IRunContext runContext, IFrameworkHandle frameworkHandle)
        {
            try
            {
                var testsList      = tests.ToList();
                var testCollection = TestCollection.FromSources(testsList.Select(x => x.Source).Distinct());

                var testMapping =
                    new Dictionary <Test, TestCase>(
                        testCollection.Tests
                        .Select(x => new KeyValuePair <Test, TestCase>(x, testsList.FirstOrDefault(y => x.IsForTestCase(y))))
                        .Where(x => x.Value != null));

                testCollection.Filter(testMapping.ContainsKey);

                ExecuteTestRun(testCollection, frameworkHandle, testMapping);
            }
            catch (Exception ex)
            {
                File.WriteAllText("C:/Users/seamillo/Desktop/jazsharp.testadapter.log", ex.ToString());
                throw;
            }
        }
Ejemplo n.º 7
0
        public void RunTests(IEnumerable <string> sources, IRunContext runContext, IFrameworkHandle frameworkHandle)
        {
            var testCollection = TestCollection.FromSources(sources);

            ExecuteTestRun(testCollection, frameworkHandle, testCollection.Tests.ToDictionary(x => x, x => x.ToTestCase()));
        }