示例#1
0
        public void IsValidInput_IsFalse_WhenSourceDirectorySuppliedDoesNotExist()
        {
            // Arrange
            var dockerfileCommand = new DockerfileCommand { SourceDir = _testDir.GenerateRandomChildDirPath() };
            var testConsole = new TestConsole();

            // Act
            var isValidInput = dockerfileCommand.IsValidInput(null, testConsole);

            // Assert
            Assert.False(isValidInput);
            Assert.Contains("Could not find the source directory", testConsole.StdError);
        }
示例#2
0
        public void IsValidInput_IsFalse_WhenPlatformVersionSpecified_WithoutPlatformName()
        {
            // Arrange
            var dockerfileCommand = new DockerfileCommand { SourceDir = string.Empty, PlatformVersion = "1.0.0" };
            var testConsole = new TestConsole();

            // Act
            var isValidInput = dockerfileCommand.IsValidInput(null, testConsole);

            // Assert
            Assert.False(isValidInput);
            Assert.Contains("Cannot use language version without specifying language name also.", testConsole.StdError);
        }
示例#3
0
        public void IsValidInput_UsesCurrentDirectory_WhenSourceDirectoryNotSupplied()
        {
            // Arrange
            var dockerfileCommand = new DockerfileCommand { SourceDir = string.Empty };
            var testConsole = new TestConsole();

            // Act
            var isValidInput = dockerfileCommand.IsValidInput(null, testConsole);

            // Assert
            Assert.True(isValidInput);
            Assert.Equal(Directory.GetCurrentDirectory(), dockerfileCommand.SourceDir);
        }