Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }