public void DefaultTest() { IOryxArguments args = new LinuxConsumptionFunctionAppOryxArguments(); Assert.False(args.RunOryxBuild); Assert.True(args.SkipKuduSync); Assert.Equal(BuildOptimizationsFlags.Off, args.Flags); var mockedContext = new DeploymentContext() { RepositoryPath = "RepositoryPath", BuildTempPath = "BuildTempPath", // Should be ignored OutputPath = "OutputPath" }; string command = args.GenerateOryxBuildCommand(mockedContext); Assert.Equal("oryx build RepositoryPath -o OutputPath", command); }
public void CommandGenerationTest(string functions_worker_runtime, string expected_command) { var mockedEnvironment = new Dictionary <string, string>() { { "FUNCTIONS_WORKER_RUNTIME", functions_worker_runtime }, }; var mockedContext = new DeploymentContext() { RepositoryPath = "RepositoryPath", BuildTempPath = "BuildTempPath", // Should be ignored OutputPath = "OutputPath" // Should be ignored }; using (new TestScopedEnvironmentVariable(mockedEnvironment)) { IOryxArguments args = new LinuxConsumptionFunctionAppOryxArguments(); string command = args.GenerateOryxBuildCommand(mockedContext); Assert.Equal(expected_command, command); } }