public void BuildNewWebApi_ShouldReturnCommand() { var expectedCommand = "new webapi"; var result = new DotNetCommandBuilder() .NewWebApi() .Build(); result.Should().Be(expectedCommand); }
public void BuildNewClassLib_ShouldReturnCommand() { var expectedCommand = "new classlib"; var result = new DotNetCommandBuilder() .NewClassLib() .Build(); result.Should().Be(expectedCommand); }
public void BuildNewSolution_ShouldReturnCommand() { var expectedCommand = "new sln"; var result = new DotNetCommandBuilder() .NewSolution() .Build(); result.Should().Be(expectedCommand); }
public void BuildNewClassLibWithNoRestore_ShouldReturnCommand() { var expectedCommand = "new classlib --no-restore"; var result = new DotNetCommandBuilder() .NewClassLib() .WithNoRestore() .Build(); result.Should().Be(expectedCommand); }
public void BuildNewSolutionWithName_ShouldReturnCommand() { var expectedCommand = "new sln -n validName"; var result = new DotNetCommandBuilder() .NewSolution() .WithName("validName") .Build(); result.Should().Be(expectedCommand); }
public void BuildNewSolutionWithPath_ShouldReturnCommand() { var expectedCommand = "new sln -o validPath"; var result = new DotNetCommandBuilder() .NewSolution() .WithPath("validPath") .Build(); result.Should().Be(expectedCommand); }
public void Create_ShouldThrowException_WhenSolutionNameIsInvalid() { var commandBuilder = new DotNetCommandBuilder(); var dotnetCli = new DotNetCliExecutor(commandBuilder); var solution = new Solution(dotnetCli); var projectPath = "test"; var solutionName = " "; Assert.Throws <ArgumentException>( () => solution.Create(projectPath, solutionName) ); }
public void Create_ShouldCreateFolderAndSolutionFile() { var commandBuilder = new DotNetCommandBuilder(); var dotnetCli = new DotNetCliExecutor(commandBuilder); var solution = new Solution(dotnetCli); var projectPath = "test"; var solutionName = "SolutionName"; solution.Create(projectPath, solutionName); Environment.CurrentDirectory.Should().Contain("test"); File.Exists($"{solutionName}.sln"); }
public DotNetCliExecutorTest() { var commandBuilder = new DotNetCommandBuilder(); _dotnetCli = new DotNetCliExecutor(commandBuilder); }