Esempio n. 1
0
        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));
            }
        }
Esempio n. 2
0
        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);
        }
Esempio n. 4
0
        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();
            }
        }
Esempio n. 5
0
        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);
        }