public void LoadPluginsTest()
        {
            var api     = new Mock <IPlayniteAPI>();
            var factory = new ExtensionFactory(new GameDatabase(), new GameControllerFactory());

            var descriptors = factory.GetExtensionDescriptors();

            Assert.AreEqual(2, descriptors.Count);

            factory.LoadPlugins(api.Object, null, false);
            Assert.AreEqual(2, factory.Plugins.Count);
        }
Exemplo n.º 2
0
        public void LoadGenericPluginTest()
        {
            var api     = new Mock <IPlayniteAPI>();
            var factory = new ExtensionFactory(new GameDatabase(), new GameControllerFactory());

            var descriptors = factory.GetExtensionDescriptors();

            Assert.AreEqual(2, descriptors.Count);

            var descriptor = descriptors[0];

            factory.LoadGenericPlugins(api.Object, null);
            Assert.AreEqual(1, factory.GenericPlugins.Count);
            Assert.AreEqual(0, factory.LibraryPlugins.Count);

            factory.LoadGenericPlugins(api.Object, new List <string>()
            {
                "TestPlugin"
            });
            Assert.AreEqual(0, factory.GenericPlugins.Count);
        }