public override void BeforeTest(TestDetails testDetails) { if (ThrowBeforeException) { throw new InvalidOperationException("Failure in BeforeTest."); } }
public virtual List <TestDetails> GetAllTestWithType() { SqlConnection connection = new SqlConnection(Connection); string query = "SELECT * FROM testDetail"; connection.Open(); SqlCommand command = new SqlCommand(query, connection); SqlDataReader reader = command.ExecuteReader(); List <TestDetails> TestList = new List <TestDetails>(); if (reader.HasRows) { while (reader.Read()) { string name = reader["test"].ToString(); decimal Fee = (decimal)reader["fee"]; string type = reader["type"].ToString(); TestDetails test = new TestDetails(name, Fee, type); TestList.Add(test); } reader.Close(); } connection.Close(); return(TestList); }
public void StartTest(ReporterTestInfo testInfo) { currentTest = new Test(index, testInfo.TestName, executionUid + "-" + index); DateTime dateTime = DateTime.Now; currentTest.timestamp = dateTime.ToString("HH:mm:ss"); currentTest.date = dateTime.ToString("yyyy/MM/dd"); currentTest.className = testInfo.FullyQualifiedTestClassName; currentTest.description = testInfo.FullyQualifiedTestClassName; string scenarioName = testInfo.FullyQualifiedTestClassName.Split('.')[testInfo.FullyQualifiedTestClassName.Split('.').Length - 2]; Scenario scenario; if (machine.IsChildWithNameExists(scenarioName)) { scenario = (Scenario)machine.GetChildWithName(scenarioName); } else { scenario = new Scenario(scenarioName); if (machine.children != null) { // We need to copy all the properties from the first scenario. // Failing to do so will cause that the tests in the ElsaticSearch, for example, will not have properties. scenario.scenarioProperties = ((Scenario)machine.children[0]).scenarioProperties; } machine.AddChild(scenario); } scenario.AddChild(currentTest); ExecutionWasAddedOrUpdated(execution); testDetails = new TestDetails(currentTest.uid); }
public async Task <IActionResult> Edit(int id, [Bind("TestId,Status")] TestDetails testDetails) { if (id != testDetails.TestId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(testDetails); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TestDetailsExists(testDetails.TestId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(testDetails)); }
public ActionResult GetTests(string TestGroupID) { try { int testGroupID = Convert.ToInt32(TestGroupID); IEnumerable <REF_TEST_X_TEST_GROUP_TB> testGroupByTest = _testRepo.GetTestsByTestGroupID(testGroupID); List <TestDetails> testDetails = new List <TestDetails>(); foreach (var row in testGroupByTest) { TestDetails item = new TestDetails() { TestDescription = row.REF_TEST_TB.SZ_DESCRIPTION, TestGroupID = row.N_TEST_GROUP_SYSID, TestID = row.N_TEST_SYSID }; testDetails.Add(item); } return(Json(testDetails, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { if (ex.InnerException == null) { ViewBag.Message = "Function: TestGroupController.GetTests_GET\n\nError: " + ex.Message; } else { ViewBag.Message = "Function: TestGroupController.GetTests_GET\n\nError: " + (ex.Message + "\n\nInnerException: " + ex.InnerException.Message); }; Session["ErrorMessage"] = ViewBag.Message; return(RedirectToAction("InternalServerError", "Error")); }; }
public void AfterTest(TestDetails testDetails) { _watch.Stop(); Console.WriteLine(testDetails.Fixture); Console.WriteLine("Execution Time: {0}", _watch.Elapsed); }
/// <summary> /// Unset keyboard controller /// </summary> public override void AfterTest(TestDetails testDetails) { // Shut down (and implicitly dispose) the keyboard controller we created. KeyboardController.Shutdown(); base.AfterTest(testDetails); }
protected StepBuilder(Expression <Action> action, string callerMember) { ExistingSteps = new List <Step> { new Step(action, StepType.Given) }; TestDetails = new TestDetails(callerMember, Guid.NewGuid()); }
public void AfterTest(TestDetails details) { Console.WriteLine("----- Beginning Duality environment teardown -----"); // Remove NUnit Console logs Log.Game.RemoveOutput(this.consoleLogOutput); Log.Core.RemoveOutput(this.consoleLogOutput); Log.Editor.RemoveOutput(this.consoleLogOutput); this.consoleLogOutput = null; if (this.dummyWindow != null) { ContentProvider.ClearContent(); ContentProvider.DisposeDefaultContent(); this.dummyWindow.Dispose(); this.dummyWindow = null; } DualityApp.Terminate(); Environment.CurrentDirectory = this.oldEnvDir; // Save local testing memory if (TestContext.CurrentContext.Result.Status == TestStatus.Passed && !System.Diagnostics.Debugger.IsAttached) { Formatter.WriteObject(TestHelper.LocalTestMemory, TestHelper.LocalTestMemoryFilePath, FormattingMethod.Xml); } Console.WriteLine("----- Duality environment teardown complete -----"); }
public override void BeforeTest(TestDetails details) { if (!details.IsSuite) { return; } if (TestActorSystem.Instance != null) { return; } var system = ActorSystem.Configure() .Playground() .UseInMemoryPubSubStore() .StreamProvider <AzureQueueStreamProvider>("aqp", new Dictionary <string, string> { { "DataConnectionString", "UseDevelopmentStorage=true" }, { "DeploymentId", "test" }, }) .TweakCluster(cfg => { cfg.DefaultKeepAliveTimeout(TimeSpan.FromMinutes(1)); cfg.Globals.RegisterStorageProvider <MemoryStorage>("MemoryStore"); }) .Assemblies(GetType().Assembly) .Interceptor <TestInterceptor>(); TestActorSystem.Instance = system.Done(); TestActorSystem.Instance.Start(); }
internal StepBuilder(Runnable runnable, string callerMember, string callerFile) { ExistingSteps = new List <Step> { new Step(runnable, StepType.Given) }; TestDetails = new TestDetails(callerMember, callerFile, Guid.NewGuid()); }
public void BeforeTest(TestDetails testDetails) { if (ScriptingEnvironment.IsRunningOnMono() && (ScriptingEnvironment.GetMonoVersion() < new Version(major, minor, build))) { Assert.Ignore($"Requires Mono {major}.{minor}.{build} or above"); } }
public void BeforeTest(TestDetails testDetails) { if (ScriptingEnvironment.IsRunningOnMono() && (ScriptingEnvironment.GetMonoVersion() < new Version(4, 0, 0))) { Assert.Ignore("Requires Mono 4"); } }
public override void AfterTest(TestDetails testDetails) { if (ThrowAfterException) { throw new InvalidOperationException("Failure in AfterTest."); } }
public void BeforeTest(TestDetails details) { Console.WriteLine("----- Beginning Duality Editor environment setup -----"); // Set environment directory to Duality binary directory this.oldEnvDir = Environment.CurrentDirectory; string codeBaseURI = typeof(DualityEditorApp).Assembly.CodeBase; string codeBasePath = codeBaseURI.StartsWith("file:") ? codeBaseURI.Remove(0, "file:".Length) : codeBaseURI; codeBasePath = codeBasePath.TrimStart('/'); Console.WriteLine("Testing Editor Assembly: {0}", codeBasePath); Environment.CurrentDirectory = Path.GetDirectoryName(codeBasePath); // Add some Console logs manually for NUnit if (this.consoleLogOutput == null) { this.consoleLogOutput = new TextWriterLogOutput(Console.Out); } Log.AddGlobalOutput(this.consoleLogOutput); // Create a dummy window for the editor if (this.dummyWindow == null) { this.dummyWindow = new MainForm(); } // Initialize the Duality Editor DualityEditorApp.Init(this.dummyWindow, false); Console.WriteLine("----- Duality Editor environment setup complete -----"); }
public bool LastTestViewSuccess(TestDetails detail) { //detail.posted_time = DateTime.ParseExact(detail.posted_time, "yyyy-MM-dd HH:mm:ss", null).ToString("dd/MM/yyyy HH:mm"); tests.Insert(0, detail); tests.OrderByDescending(x => x.posted_time); return(true); }
/// <summary/> public override void BeforeTest(TestDetails testDetails) { if (!MiscUtils.IsUserAdmin) { Assert.Ignore("Requires administrator privileges"); } }
public async Task <IActionResult> Edit(int id, [Bind("AthleteId,AthleteName,TestId,Distance,MyProperty")] TestDetails testDetails) { if (id != testDetails.AthleteId) { return(NotFound()); } if (ModelState.IsValid) { try { testDetails.MyProperty = this.checkFitness(testDetails.Distance); _context.Update(testDetails); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TestDetailsExists(testDetails.AthleteId)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index", "TestDetails", new { id = testDetails.TestId })); } return(View(testDetails)); }
public IActionResult Dashboard() { List <StudentScore> stu = _context.StudentScores.Where(s => s.StudentID == "student1").ToList(); StudentDashboardViewModel testDetails = new StudentDashboardViewModel(); testDetails.StudentId = "student1"; foreach (StudentScore ts in stu) { var details = _context.Tests.Where(s => s.TestID == ts.TestID).FirstOrDefault(); TestDetails temp = new TestDetails { TestName = details.TestName, TestId = ts.TestID, Course = details.CourseID, CourseId = details.CourseID, Marks = ts.MarksScored.ToString(), MaxMarks = details.MaxMarks.ToString(), PassOrFail = ts.MarksScored >= Convert.ToInt32(details.CutOffMarks) ? "Y" : "N" }; testDetails.TestDetail.Add(temp); } return(View(testDetails)); }
public void BeforeTest(TestDetails testDetails) { if (!ScriptingEnvironment.IsNet45OrNewer()) { Assert.Ignore("Requires .NET 4.5"); } }
public void AfterTest(TestDetails details) { Console.WriteLine("----- Beginning Duality environment teardown -----"); // Remove NUnit Console logs Log.RemoveGlobalOutput(this.consoleLogOutput); this.consoleLogOutput = null; if (this.dummyWindow != null) { ContentProvider.ClearContent(); ContentProvider.DisposeDefaultContent(); this.dummyWindow.Dispose(); this.dummyWindow = null; } // Save local testing memory. As this uses Duality serializers, // it needs to be done before terminating Duality. if (TestContext.CurrentContext.Result.Status == TestStatus.Passed && !System.Diagnostics.Debugger.IsAttached) { Serializer.WriteObject(TestHelper.LocalTestMemory, TestHelper.LocalTestMemoryFilePath, typeof(XmlSerializer)); } DualityApp.Terminate(); Environment.CurrentDirectory = this.oldEnvDir; Console.WriteLine("----- Duality environment teardown complete -----"); }
/// <summary/> public override void BeforeTest(TestDetails testDetails) { base.BeforeTest(testDetails); m_activationContext = new ActivationContextHelper("FieldWorks.Tests.manifest"); m_currentActivation = m_activationContext.Activate(); m_debugProcs = new DebugProcs(); if (!Platform.IsWindows) { try { using (var process = System.Diagnostics.Process.GetCurrentProcess()) { // try to change PTRACE option so that unmanaged call stacks show more useful // information. Since Ubuntu 10.10 a normal user is no longer allowed to use // PTRACE. This prevents call stacks and assertions from working properly. // However, we can set a flag on the currently running process to allow // it. See also the similar code in Generic/ModuleEntry.cpp prctl(PR_SET_PTRACER, (IntPtr)process.Id, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero); } } catch (Exception e) { // just ignore any errors we get } } }
// GET: Tests/Details/5 public async Task <IActionResult> Details(int?id) { if (id == null) { return(NotFound()); } var test = await _context.Test .FirstOrDefaultAsync(m => m.Id == id); if (test == null) { return(NotFound()); } if (test.Type == "Coopertest") { TempData["time"] = "hidden"; } else { TempData["dist"] = "hidden"; } var details = await _context.UserTestMapping.Where(m => m.TId == test.Id).Include(x => x.User).ToListAsync(); TempData["TId"] = test.Id; var model = new TestDetails(test, details); return(View(model)); }
public void AddTestDetails(int executionId, TestDetails testDetails) { WebRequest request = WebRequest.Create(baseUri + "executions/" + executionId + "/details"); request.Method = "POST"; SendContent(request, testDetails); }
//Insert New member in test public ActionResult InsertAthlete(MemberTestMapping mb_details) { var checkIfAlreadyAddedOrNot = (from mt in DB.MemberTestMapping where mt.MemberId == mb_details.MemberId && mt.TestDetailsId == mb_details.TestDetailsId select mt).ToList(); TestDetails getTestDetails = (from td in DB.TestDetails where td.TestDetailsId == mb_details.TestDetailsId select td).SingleOrDefault(); int?noOfCount = getTestDetails.NoOfParticipants; if (checkIfAlreadyAddedOrNot.Count > 0) { return(Json(new { msgdetail = "faill", resultCode = 2 })); } DB.MemberTestMapping.Add(mb_details); int result = DB.SaveChanges(); if (result > 0) { noOfCount = noOfCount + 1; } getTestDetails.NoOfParticipants = noOfCount; DB.SaveChanges(); return(Json(new { msgdetail = "success", resultCode = result })); }
/// <summary> /// Executed after each test is run /// </summary> /// <param name="testDetails">Provides details about the test that has just been run.</param> public override void AfterTest(TestDetails testDetails) { if (WhenToClear == Clear.AfterTest) { ClearCaches( ); } }
internal async Task <Scenario> Invoke(TestDetails testDetails) { var scenario = new Scenario(ExistingSteps, testDetails); await scenario.Execute(); return(scenario); }
/// <summary> /// Executed before each test is run /// </summary> /// <param name="testDetails">Provides details about the test that is going to be run.</param> public override void BeforeTest(TestDetails testDetails) { if (WhenToClear == Clear.BeforeTest) { ClearCaches( ); } }
/// <summary> /// Set the message box adapter /// </summary> public override void BeforeTest(TestDetails testDetails) { base.BeforeTest(testDetails); m_PreviousAdapter = s_CurrentAdapter; s_CurrentAdapter = (IMessageBox)Activator.CreateInstance(m_AdapterType); MessageBoxUtils.Manager.SetMessageBoxAdapter(s_CurrentAdapter); }
public void BeforeTest(TestDetails testDetails) { if (!IsNet45OrNewer()) { Assert.Ignore("Requires .NET 4.5"); } }