public void SetDefault_Execute_ReturnsNotFoundMessage() { var command = new SetDefaultCommand(_console, LoggerMock.GetLogger <SetDefaultCommand>().Object, _projectService.Object, _jobDefinitionService.Object) { Project = "Project 2", Name = "Default" }; var resultMessage = command.Execute(); Assert.Equal("Failed to set job definition Default as default. Make sure the project and job definition names are correct.", resultMessage); }
public void SetDefault_Execute_ReturnsSuccessMessage() { _jobDefinitionService.Setup(j => j.SetJobDefinitionAsDefault(It.IsAny <int>(), It.IsAny <int>())).Returns(Task.CompletedTask); var command = new SetDefaultCommand(_console, LoggerMock.GetLogger <SetDefaultCommand>().Object, _projectService.Object, _jobDefinitionService.Object) { Project = "Project 1", Name = "Default" }; var resultMessage = command.Execute(); Assert.Equal("Job definition Default has been set to default", resultMessage); }