Exemplo n.º 1
0
        public void ConstructV3PublishingTask()
        {
            var manifestFullPath = TestInputs.GetFullPath(Path.Combine("Manifests", "SampleV3.xml"));

            var buildEngine = new MockBuildEngine();
            var task        = new PublishArtifactsInManifest()
            {
                BuildEngine    = buildEngine,
                TargetChannels = GeneralTestingChannelId
            };

            // Dependency Injection setup
            var collection = new ServiceCollection()
                             .AddSingleton <IFileSystem, FileSystem>()
                             .AddSingleton <IBuildModelFactory, BuildModelFactory>();

            task.ConfigureServices(collection);
            using var provider = collection.BuildServiceProvider();

            // Act and Assert
            task.InvokeExecute(provider);

            var which = task.WhichPublishingTask(manifestFullPath);

            which.Should().BeOfType <PublishArtifactsInManifestV3>();
        }
Exemplo n.º 2
0
        public void ConstructV3PublishingTask()
        {
            var manifestFullPath = TestInputs.GetFullPath(Path.Combine("Manifests", "SampleV3.xml"));

            var buildEngine = new MockBuildEngine();
            var task        = new PublishArtifactsInManifest()
            {
                BuildEngine    = buildEngine,
                TargetChannels = GeneralTestingChannelId
            };

            var which = task.WhichPublishingTask(manifestFullPath);

            which.Should().BeOfType <PublishArtifactsInManifestV3>();
        }
Exemplo n.º 3
0
        public void ConstructV3PublishingTask()
        {
            var testInputs       = Path.Combine(Path.GetDirectoryName(typeof(PublishArtifactsInManifestTests).Assembly.Location), "TestInputs", "Manifests");
            var manifestFullPath = Path.Combine(testInputs, "SampleV3.xml");

            var buildEngine = new MockBuildEngine();
            var task        = new PublishArtifactsInManifest()
            {
                BuildEngine    = buildEngine,
                TargetChannels = GeneralTestingChannelId
            };

            var which = task.WhichPublishingTask(manifestFullPath);

            Assert.IsType <PublishArtifactsInManifestV3>(which);
        }