public void InitializeShouldThrowIfArgumentIsNonNull() { // Parallel should not have any values or arguments ExceptionUtilities.ThrowsException <CommandLineException>( () => this.executor.Initialize("123"), "Argument " + 123 + " is not expected in the 'Parallel' command. Specify the command without the argument (Example: vstest.console.exe myTests.dll /Parallel) and try again."); }
public void InIsolationArgumentProcessorExecutorShouldThrowIfArgumentIsProvided() { // InProcess should not have any values or arguments ExceptionUtilities.ThrowsException <CommandLineException>( () => this.executor.Initialize("true"), "Argument true is not expected in the 'InIsolation' command. Specify the command without the argument (Example: vstest.console.exe myTests.dll /InIsolation) and try again."); }
public void InitializeShouldThrowIfArgumentIsInvalid() { ExceptionUtilities.ThrowsException <CommandLineException>( () => this.executor.Initialize("foo"), "Invalid .Net Framework version:{0}. Please give the fullname of the TargetFramework(Example: .NETCoreApp,Version=v2.0). Other supported .Net Framework versions are Framework40, Framework45, FrameworkCore10 and FrameworkUap10.", "foo"); }
public void InitializeShouldThrowIfArgumentIsNotASupportedArchitecture() { ExceptionUtilities.ThrowsException <CommandLineException>( () => this.executor.Initialize("AnyCPU"), "Invalid platform type:{0}. Valid platform types are x86, x64 and Arm.", "AnyCPU"); }
public void InitializeShouldThrowExceptionIfArgumentIsWhiteSpace() { Action action = () => new RunSettingsArgumentExecutor(CommandLineOptions.Instance, null).Initialize(" "); ExceptionUtilities.ThrowsException <CommandLineException>( action, "The /Settings parameter requires a settings file to be provided."); }
public void InitializeShouldThrowExceptionIfFileDoesNotExist() { var fileName = "C:\\Imaginary\\nonExistentFile.txt"; var executor = new RunSettingsArgumentExecutor(CommandLineOptions.Instance, null); var mockFileHelper = new Mock <IFileHelper>(); mockFileHelper.Setup(fh => fh.Exists(It.IsAny <string>())).Returns(false); executor.FileHelper = mockFileHelper.Object; ExceptionUtilities.ThrowsException <CommandLineException>( () => executor.Initialize(fileName), "The Settings file '{0}' could not be found.", fileName); }
public void InitializeShouldThrowIfRunSettingsSchemaDoesNotMatch() { // Arrange. var fileName = "C:\\temp\\r.runsettings"; var settingsXml = "<BadRunSettings></BadRunSettings>"; var executor = new TestableRunSettingsArgumentExecutor( CommandLineOptions.Instance, this.settingsProvider, settingsXml); // Setup mocks. var mockFileHelper = new Mock <IFileHelper>(); mockFileHelper.Setup(fh => fh.Exists(It.IsAny <string>())).Returns(true); executor.FileHelper = mockFileHelper.Object; // Act and Assert. ExceptionUtilities.ThrowsException <SettingsException>( () => executor.Initialize(fileName), "Settings file provided does not conform to required format."); }
public void InitializeShouldThrowIfArgumentIsEmpty() { ExceptionUtilities.ThrowsException <CommandLineException>( () => executor.Initialize(" "), "The /Framework argument requires the target .Net Framework version for the test run. Example: /Framework:\".NETFramework,Version=v4.5.1\""); }
public void InitializeShouldThrowIfArgumentIsEmpty() { ExceptionUtilities.ThrowsException <CommandLineException>( () => this.executor.Initialize(" "), "The /Platform argument requires the target platform type for the test run to be provided. Example: /Platform:x86"); }