Esempio n. 1
0
        public void SetPluginTileComponentTest()
        {
            //Arrange
            PluginResolver pluginResolver = new PluginResolver();

            pluginResolver.AddPlugin(typeof(TestPlugin.TestPlugin), "TestKey");
            pluginResolver.LoadPluginTileComponent(typeof(TestTileComponent), "TestTileKey");

            var oldComponent = pluginResolver.GetPluginTileComponent("TestKey", "TestTileKey");

            oldComponent.Data           = new PluginData();
            oldComponent.PluginSettings = new PluginData();

            var newComponent = new TestTileComponent();

            //Act
            pluginResolver.SetPluginTileComponent("TestTileKey", newComponent);

            //Assert
            Assert.NotEqual(oldComponent, pluginResolver.GetPluginTileComponent("TestKey", "TestTileKey"));
            Assert.Equal(newComponent, pluginResolver.GetPluginTileComponent("TestKey", "TestTileKey"));
            Assert.Equal("TestKey", newComponent.PluginKey);
            Assert.Equal("TestTileKey", newComponent.TileKey);
            Assert.NotNull(newComponent.Data);
            Assert.NotNull(newComponent.PluginSettings);
        }
Esempio n. 2
0
        public async Task <PluginTileComponent> GetPluginTileComponent(string pluginKey, string tileKey)
        {
            await TileLock.WaitAsync();

            var tile = _pluginResolver.GetPluginTileComponent(pluginKey, tileKey);

            TileLock.Release();

            return(tile);
        }
Esempio n. 3
0
        public void GetPluginTileComponentTest()
        {
            //Arrange
            PluginResolver pluginResolver = new PluginResolver();

            pluginResolver.AddPlugin(typeof(TestPlugin.TestPlugin), "TestKey");
            pluginResolver.LoadPluginTileComponent(typeof(TestTileComponent), "TestTileKey");

            //Act
            var tileComponent = pluginResolver.GetPluginTileComponent("TestKey", "TestTileKey");

            //Assert
            Assert.NotNull(tileComponent);
            Assert.Equal(typeof(TestTileComponent), tileComponent.GetType());
            Assert.Equal("TestTileKey", tileComponent.TileKey);
            Assert.Equal("TestKey", tileComponent.PluginKey);
        }