Exemple #1
0
        public void GetTaskProvider_ReturnsNull()
        {
            var taskProviderManager = new TaskProviderManager(_taskProviders, _engineConfig.Object, _taskProviderProcess.Object, _logger.Object);
            var item = taskProviderManager.GetTaskProvider("NotExistProvider", "not-exist-taskProvider");

            Assert.Null(item);
        }
Exemple #2
0
        public async void RefreshTaskProvider_TaskProviderLoaded()
        {
            var workingLocation = Path.Combine(AppContext.BaseDirectory, "working", "20180817.1");

            if (Directory.Exists(workingLocation))
            {
                Directory.Delete(workingLocation, true);
            }

            Directory.CreateDirectory(workingLocation);

            var taskProviderName = "Polyrific.Catapult.TaskProviders.TestTaskProvider";
            var taskProviderType = "TestTaskProvider";
            var publishLocation  = Path.Combine(workingLocation, "publish");

            _engineConfig.SetupGet(e => e.TaskProvidersLocation).Returns(publishLocation);

            await GenerateTestTaskProvider(taskProviderName, taskProviderType, workingLocation, publishLocation);

            var taskProviderManager = new TaskProviderManager(_taskProviders, _engineConfig.Object, _taskProviderProcess.Object, _logger.Object);

            taskProviderManager.RefreshTaskProviders();

            var newTaskProvider = taskProviderManager.GetTaskProvider(taskProviderType, taskProviderName);

            Assert.NotNull(newTaskProvider);
            Assert.Equal(Path.Combine(publishLocation, $"{taskProviderName}.dll"), newTaskProvider.StartFilePath);
        }
Exemple #3
0
        public void GetTaskProvider_ReturnsTaskProviderItem()
        {
            var taskProviderManager = new TaskProviderManager(_taskProviders, _engineConfig.Object, _taskProviderProcess.Object, _logger.Object);
            var item = taskProviderManager.GetTaskProvider("FakeProvider", "fake-taskProvider");

            Assert.NotNull(item);
            Assert.Equal("fake-taskProvider", item.Name);
        }