Example #1
0
        public void TestRun()
        {
            TestPicker         picker = new TestPicker(@"C:\Melkor\", Guid.NewGuid());
            List <TestContext> list   = picker.Test();

            if (list.Count != 0)
            {
                Console.WriteLine("Testiram zadaću");
                foreach (var test in list)
                {
                    Console.WriteLine(test.Name);
                    Console.WriteLine(test.Dir);
                    Assert.IsTrue(test.Result);
                }
            }
        }
Example #2
0
        public async Task <ActionResult> BuildResult()
        {
            Builder builder = new Builder(_location);

            ApplicationUser currentUser = await _userManager.GetUserAsync(HttpContext.User);

            string output = _location + @"\" + Guid.Parse(currentUser.Id).ToString() + @"\output";

            var resultBuildItems = builder.Build(output);

            var tester  = new TestPicker(output, Guid.Parse(currentUser.Id));
            var results = tester.Test();

            try
            {
                if (results != null)
                {
                    foreach (var element in results)
                    {
                        var buildItem = resultBuildItems.FirstOrDefault(s => s.Dir.Equals(element.Dir));

                        buildItem?.Tests.Add(element);

                        testRepo.Add(new TestContext(element.Name, element.Dir, element.Result,
                                                     Guid.Parse(currentUser.Id)));
                    }
                }
            }
            catch (Exception ex)
            {
                ViewData["Message"] = "ERROR " + ex.Message + "  " + ex.InnerException;
            }


            return(PartialView("BuildResultView", resultBuildItems));
        }