public async Task <IActionResult> Post([FromBody] Project project) { if (!ModelState.IsValid) { return(new BadRequestObjectResult(ModelState)); } var builderSettings = _iconfiguration.Get <BuilderSettings>(); var builder = new BuildSolution(builderSettings); string result = null; try { result = await builder.RunAsync(project); } catch (Exception ex) { result = ex.ToString(); } if (result.Equals("Success")) { return(Ok("Success")); } else { return(BadRequest(result)); } }
public void SetUp() { theSolution = new Solution(); theBuild = new BuildSolution(theSolution); theRunner = MockRepository.GenerateMock <Local.IRippleStepRunner>(); theBuild.Execute(theRunner); }
public SolutionViewModel(BuildSolution solution) { ObservableCollection <ProjectViewModel> p = new ObservableCollection <ProjectViewModel>(); this.solution = solution; foreach (ProjectInSolution projectInSolution in this.solution.ProjectsInSolution) { p.Add(new ProjectViewModel(projectInSolution)); } this.Projects = CollectionViewSource.GetDefaultView(p); }
public async Task Run(BuilderSettings builderSettings) { var builder = new BuildSolution(builderSettings); var testProject = new KitchenModel(); string messages = await builder.RunAsync(testProject.Project); Console.WriteLine(messages); if (!messages.Equals("Success")) { Console.Read(); } }
public void SetUp() { theSolution = new Solution(); theBuild = new BuildSolution(theSolution); theRunner = MockRepository.GenerateMock <Local.IRippleStepRunner>(); theException = new NotImplementedException(); theRunner.Expect(x => x.BuildSolution(theSolution)).Throw(theException); Exception <NotImplementedException> .ShouldBeThrownBy(() => { theBuild.Execute(theRunner); }).ShouldBeTheSameAs(theException); }