Skip to content

Commit

Permalink
add ArtifactProcessingPostProcessMode_ContainsPostProcessCommand
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoRossignoli committed Feb 11, 2022
1 parent 58583ad commit 75e71d0
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,21 @@
namespace Microsoft.VisualStudio.TestPlatform.CommandLine.UnitTests.Processors;

using System;

using Microsoft.VisualStudio.TestPlatform.ObjectModel.Engine;
using Microsoft.VisualStudio.TestPlatform.Utilities;

using Moq;

using TestPlatform.CommandLine.Processors;

using TestTools.UnitTesting;

[TestClass]
public class ArtifactProcessingPostProcessModeProcessorTest
{
private readonly Mock<IArtifactProcessingManager> artifactProcessingManagerMock = new();
private readonly Mock<IFeatureFlag> featureFlagMock = new();

[TestMethod]
public void ProcessorExecutorInitialize_ShouldFailIfNullCtor()
Expand Down Expand Up @@ -55,4 +61,15 @@ public void ProcessorExecutorInitialize_ExceptionShouldNotBubbleUp()
artifactProcessingPostProcessModeProcessorExecutor.Initialize(null);
Assert.AreEqual(ArgumentProcessorResult.Fail, artifactProcessingPostProcessModeProcessorExecutor.Execute());
}

[TestMethod]
public void ArtifactProcessingPostProcessMode_ContainsPostProcessCommand()
{
featureFlagMock.Setup(x => x.IsEnabled(It.IsAny<string>())).Returns(true);
Assert.IsTrue(ArtifactProcessingPostProcessModeProcessor.ContainsPostProcessCommand(new string[] { "--artifactsProcessingMode-postprocess" }, featureFlagMock.Object));
Assert.IsTrue(ArtifactProcessingPostProcessModeProcessor.ContainsPostProcessCommand(new string[] { "--ARTIfactsProcessingMode-postprocess" }, featureFlagMock.Object));
Assert.IsFalse(ArtifactProcessingPostProcessModeProcessor.ContainsPostProcessCommand(new string[] { "-ARTIfactsProcessingMode-postprocess" }, featureFlagMock.Object));
Assert.IsFalse(ArtifactProcessingPostProcessModeProcessor.ContainsPostProcessCommand(new string[] { "--ARTIfactsProcessingMode-postproces" }, featureFlagMock.Object));
Assert.IsFalse(ArtifactProcessingPostProcessModeProcessor.ContainsPostProcessCommand(null, featureFlagMock.Object));
}
}

0 comments on commit 75e71d0

Please sign in to comment.