Example #1
0
        public void CreateService()
        {
            _extensionService = new ExtensionService();

            // Rather than actually starting the service, which would result
            // in finding the extensions actually in use on the current system,
            // we simulate the start using this assemblies dummy extensions.
            _extensionService.FindExtensionPoints(typeof(TestEngine).Assembly);
            _extensionService.FindExtensionPoints(typeof(ITestEngine).Assembly);

            _extensionService.FindExtensionsInAssembly(GetType().Assembly.Location, true);
        }
        public void CreateService()
        {
            _extensionService = new ExtensionService();

            // Rather than actually starting the service, which would result
            // in finding the extensions actually in use on the current system,
            // we simulate the start using this assemblies dummy extensions.
            _extensionService.FindExtensionPoints(typeof(TestEngine).Assembly);
            _extensionService.FindExtensionPoints(typeof(ITestEngine).Assembly);

            _extensionService.FindExtensionsInAssembly(GetType().Assembly.Location, true);
        }
Example #3
0
        public void SkipsGracefullyLoadingOtherFrameworkExtensionAssembly()
        {
            //May be null on mono
            Assume.That(Assembly.GetEntryAssembly(), Is.Not.Null, "Entry assembly is null, framework loading validation will be skipped.");

#if NETCOREAPP
            string other = "net35";         // Attempt to load the .NET 3.5 version of the extensions from the .NET Core 2.0 tests
#elif NET35
            string other = "netcoreapp2.1"; // Attempt to load the .NET Core 2.1 version of the extensions from the .NET 3.5 tests
#endif
            var assemblyName = Path.Combine(GetSiblingDirectory(other), "nunit.engine.tests.dll");
            Assert.That(assemblyName, Does.Exist);

            var service = new ExtensionService();
            service.FindExtensionPoints(typeof(TestEngine).Assembly);
            service.FindExtensionPoints(typeof(ITestEngine).Assembly);
            var extensionAssembly = new ExtensionAssembly(assemblyName, false);

            Assert.That(() => service.FindExtensionsInAssembly(extensionAssembly), Throws.Nothing);
        }