public void InitializeTask() { var m = new TestManager(); var t = m.InitializeTask(); Assert.IsNotNull(t); Assert.IsNotNull(t as InitializeStorageTask); }
public InitializeResult Initialize() { // Start the Test Manager Client that dispatches tests to execute on the server. try { if (Microsoft.SPOT.Hardware.SystemInfo.SystemID.SKU == 3) { Log.Comment("Do Not run the tests on the emulator since it doesn't have an SSL Stack."); return InitializeResult.Skip; } #if RUN_TESTS tmc = new TestManager(); tmc.Start(); #endif } catch (Exception e) { Log.Comment("Unable to start the client connection to the Server. Make sure the Server is running and actively accepting a connection."); Log.Comment("Error Code: " + e.ToString()); Log.Comment("Fail the whole test suite since it can not connect to the server."); return InitializeResult.Skip; } #if RUN_TESTS return InitializeResult.ReadyToGo; #else return InitializeResult.Skip; #endif }
public void RunObj() { var coordinator = Substitute.For<ICoordinator>(); using (var m = new TestManager(coordinator)) { m.Run(); } }
public void Test() { using (TestManager db = new TestManager()) { var query = db.Person.Select(p => p); var list = query.ToList(); } }
public void TestThatFindingAnElementWithALongTimeoutWorksInAllSupportedBrowsers(string browserName) { tm = new TestManager(browserName); tm.Browser.Navigate().GoToPage(tm.Pages.Home); tm.Pages.Home.SearchBox.SendKeys("Cheese"); tm.Pages.Home.SearchButton.Click(); var expectedResultItem = tm.Browser.FindElement(By.Name("btnG"), 1000); Assert.IsNotNull(expectedResultItem, "The expected result item was not found."); }
public Uri CreateIssue(string ownerName, string repositoryName, int testCaseId) { TestManager manager = new TestManager(); TestCase testCase = manager.GetById(testCaseId); NewIssue issue = this.PopulateIssue(testCase); Task<Issue> task = this.CreateGitHubIssue(client, ownerName, repositoryName, issue); Issue createdIssue = task.Result; return createdIssue.HtmlUrl; }
public async Task RunCheckFalse() { var coordinator = Substitute.For<ICoordinator>(); coordinator.PeriodInSeconds.Returns(100); coordinator.Check(Arg.Any<Type>()).Returns(Task.FromResult(false)); using (var m = new TestManager(coordinator)) { await m.RunAsync(); } coordinator.Received().Check(Arg.Any<Type>()); }
public void TestManager_RunTest_Will_Run_Passing_Test_Test() { TestManager manager = new TestManager(); TestMethod method = new TestMethod(); method.Name = "PassingStub"; method.Type = typeof(TestManagerTest); method.MemberInfo = PassingStub(); TestResult res = manager.RunTest(method); Confirm.Equal(true, res.Passed); Confirm.Equal("PassingStub (PASSED)", res.ResultText); }
public static void call1() { int total = 0, Testtotal = 0; OEBL.TestManager tm = new TestManager(); List <OEEntity.Question> ques = tm.GetQuestions(); List <OEEntity.Question> reslist = new List <Question>(); OEEntity.Question res; Console.WriteLine("Welcome to the Test\n\n\n"); foreach (OEEntity.Question item in ques) { res = new OEEntity.Question(); res.question = item.question; res.qid = item.qid; res.marks = item.marks; res.options = new List <OEEntity.Option>(); res.coptions = new List <Option>(); res.options = new List <Option>(); Console.WriteLine(item.question + "\t\t(" + item.marks + ") marks"); foreach (OEEntity.Option op in item.options) { Console.WriteLine(op.oid + ". " + op.option); } Console.WriteLine("\nEnter yout choice"); int choice = Int16.Parse(Console.ReadLine()); foreach (OEEntity.Option op in item.options) { if (choice == op.oid) { res.options.Add(op); } } foreach (OEEntity.Option cop in item.coptions) { res.coptions.Add(cop); } Console.Clear(); reslist.Add(res); } Console.WriteLine(tm.GetReport(reslist)); }
public HttpResponseMessage Get(string author, string title) { DirectoryManager dirman = new DirectoryManager(); TestManager testman = new TestManager(dirman); List <Question> questions = testman.GetTestData(author, title); var json = JsonConvert.SerializeObject(questions); var res = Request.CreateResponse(HttpStatusCode.OK); res.Content = new StringContent(json, System.Text.Encoding.UTF8, "application/json"); return(res); }
public VerificationTestViewModel(IUnityContainer container, TestManager testManager) : base(container, testManager.Instrument) { _container.RegisterInstance(testManager); _container.Resolve <IEventAggregator>().Subscribe(this); if (testManager == null) { throw new ArgumentNullException(nameof(testManager)); } InstrumentTestManager = testManager; QaTestRunViewItem = new QaTestRunViewModel(container, InstrumentTestManager.Instrument); }
public async Task ValidateConfigurePowerAppTables() { DataStore ds = new DataStore(); ds.AddToDataStore("SqlConnectionString", SqlCreds.GetSqlPagePayload("yashti")); ds.AddToDataStore("SqlScriptsFolder", "Service/Database/LogicApps"); Assert.IsTrue(await TestManager.IsSuccessAsync("Microsoft-DeploySQLScripts", ds, "Microsoft-TwitterTemplate")); //ds.AddToDataStore("SearchQuery", "cricket rights OR english cricket OR \"Sky AND cricket\""); ds.AddToDataStore("SearchQuery", "FA and women's performance"); Assert.IsTrue(await TestManager.IsSuccessAsync("Microsoft-ConfigurePowerAppTables", ds)); }
public void TestMatchesOrientationIsImportant() { Debug.Log("Test Matches Orientation Is Important"); StackMeta stack1 = GetStackMetaOf5WithOrientation(); StackMeta stack2 = GetStackMetaOf5WithOrientation(); TestManager.AssertTrue(stack1.Matches(stack2), "Should match"); TestManager.AssertTrue(stack2.Matches(stack1), "Should match"); TestManager.AssertTrue(stack1.Matches(stack1), "Should match"); stack2.GetChipMetaAt(0).Flip(); TestManager.AssertFalse(stack1.Matches(stack2), "Shouldn't match"); TestManager.AssertFalse(stack2.Matches(stack1), "Shouldn't match"); }
public async Task RunCheckFalse() { var coordinator = Substitute.For <ICoordinator>(); coordinator.PeriodInSeconds.Returns(100); coordinator.Check(Arg.Any <Type>()).Returns(Task.FromResult(false)); using (var m = new TestManager(coordinator)) { await m.RunAsync(); } coordinator.Received().Check(Arg.Any <Type>()); }
public async Task SetStreamAnalyticsInputTest() { // Tests the Action to set Event Hub as the input for a Stream Analyitcs job var dataStore = await TestManager.GetDataStore(true); dataStore.AddToDataStore("namespace", "POC-Namespace3"); dataStore.AddToDataStore("inputAlias", "POC-input2"); //dataStore.AddToDataStore("jobName", "LancesStreamAnalyticsJob"); dataStore.AddToDataStore("SAjob", "POC-StreamAnalyticsJob"); SetupDataStoreWithEventHubKey(dataStore); // key "primaryKey" maps to corresponding event hub's primary policy key var response = await TestManager.ExecuteActionAsync("Microsoft-SetStreamAnalyticsInputAsEventHub", dataStore); Assert.IsTrue(response.IsSuccess); }
protected void saveButton_Click(object sender, EventArgs e) { TestType aTestType = new TestType(); aTestType.TestTypeName = typeNameTextBox.Text; TestManager aTestManager = new TestManager(); outputLabel.Text = aTestManager.SaveTestType(aTestType); typeNameTextBox.Text = string.Empty; TestTypeGridView.DataSource = aTestManager.GetAllTestTypes(); TestTypeGridView.DataBind(); }
public async Task SetStreamAnalyticsQueryTest() { // Tests the Action to define the query of a Stream Analytics job var dataStore = await TestManager.GetDataStore(true); dataStore.AddToDataStore("inputAlias", "POC-input"); dataStore.AddToDataStore("outputAlias", "POC-output"); // Since we technically update the default query instead of creating one, use the default // transformation name which is "Transformation" dataStore.AddToDataStore("SAjob", "POC-StreamAnalyticsJob"); var response = await TestManager.ExecuteActionAsync("Microsoft-SetStreamAnalyticsQuery", dataStore); Assert.IsTrue(response.IsSuccess); }
private void RefreshView() { var settings = new Settings(); if (settings.ShowDialog() != DialogResult.OK) { if (string.IsNullOrWhiteSpace(_inputDir)) { Environment.Exit(-1); } return; } _confirm = settings.GetConfirm(); _inputDir = settings.GetInput(); _outputDir = settings.GetOuput(); _type = settings.GetMediaType(); _mode = settings.GetMode(); _copy = settings.GetCopy(); if (_mode != 2) { statusLabel.Text = ""; toolStripMenuItemPerform.Enabled = true; _fileManager = new FileManager(_confirm); _fileManager.ConfirmAutomaticMove += FileManagerConfirmAutomaticMove; _fileManager.OnFileMove += fileManager_OnFileMove; _fileManager.OnFileMoveFailed += fileManager_OnFileMoveFailed; _mediaFiles = _fileManager.GetMediaFileList(_inputDir, _type); foreach (var mediaFile in _mediaFiles) { var listViewItem = new ListViewItem(); listViewItem.SubItems.Add(mediaFile.ToString("O.E")); listViewItem.SubItems.Add(mediaFile.ToString(mediaFile.ToString())); listViewMediaFiles.Items.Add(listViewItem); } } else { toolStripMenuItemPerform.Enabled = false; _testManager = new TestManager(_inputDir, _type); _testManager.TestCaseDidFail += TestManagerTestCaseDidFail; _testManager.TestCaseDidPass += TestManagerTestCaseDidPass; _testManager.TestCaseEncounteredError += TestManagerTestCaseEncounteredError; var thread = new Thread(_testManager.RunTests); thread.Start(); } }
static void Main(string[] args) { //IVendingService db = new VendingDBService(); IVendingService db = new MockVendingDBService(); var items = db.GetVendingItems(); InventoryManager inventory = new InventoryManager(items); for (int rowIdx = 1; rowIdx <= inventory.RowCount; rowIdx++) { for (int colIdx = 1; colIdx <= inventory.ColCount; colIdx++) { Console.WriteLine(inventory.GetVendingItem(rowIdx, colIdx).ToString()); } } Console.WriteLine(); Console.WriteLine(); ReportManager reportManager = new ReportManager(db); Report report = reportManager.GetReport(2018, db.GetProductItems()); var reportItems = report.ReportItems; foreach (var item in reportItems) { Console.WriteLine($"{item.Name}|{item.Qty}"); } Console.WriteLine(); Console.WriteLine($"**Total Sales** {report.TotalSales.ToString("c")}"); Console.WriteLine(); Console.WriteLine(); Console.WriteLine(); ILogService log = new LogFileService(); Change change = TestManager.PopulateLogFileWithOperations(db, log); Console.WriteLine(log.GetLogData()); Console.WriteLine(); Console.WriteLine(); TransactionManager trans = new TransactionManager(db, log); Console.WriteLine($"Change: {change.Dollars} Dollars {change.Quarters} Quarters {change.Dimes} Dimes {change.Nickels} Nickels {change.Pennies} Pennies"); Console.ReadKey(); }
public async Task LocalFileNotFound() { var dataStore = await TestManager.GetDataStore(); dataStore.AddToDataStore(UploadAssetBlobStorage.BlobContainerKey, blobContainerName, DataStoreType.Public); dataStore.AddToDataStore(UploadAssetBlobStorage.AssetFileKey, "file/not/found.jpg", DataStoreType.Public); dataStore.AddToDataStore(UploadAssetBlobStorage.StorageAccountConnectionStringKey, workingStorageAccountConnectionString, DataStoreType.Public); var response = await TestManager.ExecuteActionAsync("Microsoft-UploadAssetBlobStorage", dataStore, "Microsoft-RedditTemplate"); Assert.IsTrue(response.Status == ActionStatus.Failure); Assert.IsInstanceOfType(response.Body, typeof(string)); Assert.AreEqual("file/not/found.jpg", response.Body.ToString()); Assert.AreEqual($"{UploadAssetBlobStorage.AssetFileKey} file/not/found.jpg not found", response.ExceptionDetail.AdditionalDetailsErrorMessage); }
public void ValidateIncorrectFacebookCredentials() { var dataStore = new DataStore(); dataStore.AddToDataStore("FacebookClientId", "422676881457851"); dataStore.AddToDataStore("FacebookClientSecret", "bf5fca097936ece936290031623b577a"); var response = TestManager.ExecuteAction("Microsoft-ValidateFacebookDeveloperAccount", dataStore); Assert.IsTrue(!response.IsSuccess); dataStore.AddToDataStore("FacebookClientId", ""); dataStore.AddToDataStore("FacebookClientSecret", ""); response = TestManager.ExecuteAction("Microsoft-ValidateFacebookDeveloperAccount", dataStore); Assert.IsTrue(!response.IsSuccess); }
public async Task TestUploadAssetToAzure() { var dataStore = await TestManager.GetDataStore(); dataStore.AddToDataStore(UploadAssetBlobStorage.BlobContainerKey, blobContainerName, DataStoreType.Public); dataStore.AddToDataStore(UploadAssetBlobStorage.AssetFileKey, testImageLocation, DataStoreType.Public); dataStore.AddToDataStore(UploadAssetBlobStorage.StorageAccountConnectionStringKey, workingStorageAccountConnectionString, DataStoreType.Public); var response = await TestManager.ExecuteActionAsync("Microsoft-UploadAssetBlobStorage", dataStore, "Microsoft-RedditTemplate"); Assert.IsTrue(response.Status == ActionStatus.Success); var uriString = dataStore.GetValue(UploadAssetBlobStorage.DefaultAccessAssetUriParameter); Assert.IsTrue(uriString.Contains($"{blobContainerName}/{ImageFileName}")); }
public static void MyClassInitialize(TestContext testContext) { kernel = TestManager.ConfigureNInjectKernel(); categoryDao = kernel.Get <ICategoryDao>(); productDao = kernel.Get <IProductDao>(); orderDao = kernel.Get <IOrderDao>(); tagDao = kernel.Get <ITagDao>(); cardDao = kernel.Get <ICardDao>(); userDao = kernel.Get <IUserProfileDao>(); productService = kernel.Get <IProductService>(); tagService = kernel.Get <ITagService>(); userService = kernel.Get <IUserService>(); cardService = kernel.Get <ICardService>(); orderService = kernel.Get <IOrderService>(); }
public ActionResult DelTest() { ITestBLL testBLL = new TestManager(); var id = Convert.ToInt32(Request["id"]); Test test = testBLL.LoadEntity(u => u.TestId == id).FirstOrDefault(); if (testBLL.DeleteEntity(test)) { return(Redirect("/Home/Test")); } else { return(Content("<script>alert('删除失败!');window.location.href='/Home/Test';</script>"));//刷新页面 } }
public ActionResult Search(TestViewModel tViewModel) { ViewBag.Title = "KPCL ERP :: Search"; TestManager tMan = new TestManager(); if (TempData["tViewModel"] != null) { tViewModel = (TestViewModel)TempData["tViewModel"]; } tViewModel.Processes = tMan.Get_Processes(); return(View("Search", tViewModel)); }
public void AddRecordWithInvalidGroup() { TestManager testManager = CreateTestManager(); NameValueCollection nameValueCollection = new NameValueCollection(); nameValueCollection.Add("name", "testName"); nameValueCollection.Add("surname", "testSurname"); nameValueCollection.Add("group", "20"); nameValueCollection.Add("q1", "a1"); nameValueCollection.Add("q2", "a2"); nameValueCollection.Add("q3", "a3"); string output = testManager.AddRecord(nameValueCollection, _testIp); Assert.IsNotNull(output); }
public async Task DeployFunctionAssetsNews() { var dataStore = await TestManager.GetDataStore(); //// Deploy Function dataStore.AddToDataStore("DeploymentName", "FunctionDeploymentTest"); dataStore.AddToDataStore("FunctionName", "testfunctionappe"); dataStore.AddToDataStore("apiKey", "655c7b05d8a04bf6a88647c54fd042e2"); var response = TestManager.ExecuteAction("Microsoft-DeployNewsFunctionAsset", dataStore); Assert.IsTrue(response.IsSuccess); response = TestManager.ExecuteAction("Microsoft-WaitForArmDeploymentStatus", dataStore); Assert.IsTrue(response.IsSuccess); }
public async Task VerifyLogProfileEventHub() { // Tests the Action to verify that the insights-operational-logs event hub that is created // when configuring the Log Profile actually exists var dataStore = await TestManager.GetDataStore(); var deployArmResult = await TestManager.ExecuteActionAsync( "Microsoft-CreateEventHubNameSpace", dataStore, "Microsoft-ActivityLogTemplate"); Assert.IsTrue(deployArmResult.IsSuccess); var response = await TestManager.ExecuteActionAsync("Microsoft-VerifyLogProfileEventHub", dataStore); Assert.IsTrue(response.IsSuccess); }
public Test(TestManager tm) { InitializeComponent(); this.TM = tm; TotalQuestionsLabel.Content = TM.TheTestStats.TotalQuestions; EquationLabel.Content = TM.TheTestStats.CurrentEquation.FullEquation; OLabel.Visibility = Visibility.Hidden; XLabel.Visibility = Visibility.Hidden; UserEvents.UserGotQuestionWrong += ShowBigRedX; UserEvents.UserGotQuestionRight += ShowBigGreenO; UserEvents.UserFinishedTheTest += ShowFinalResults; }
public async Task DeployNotifierLogicAppWithConnector() { var dataStore = await TestManager.GetDataStore(); dataStore.AddToDataStore("ApiConnectionName", "sqlNotifierConnection"); var response = TestManager.ExecuteAction("Microsoft-CreateSqlConnector", dataStore); response.DataStore.AddToDataStore("AzureArmFile", "Service/Notifier/notifierLogicApp.json"); response.DataStore.AddToDataStore("logicAppTrigger", "TriggerUrl"); response.DataStore.AddToDataStore("logicAppName", "notifierLogicApp"); response = TestManager.ExecuteAction("Microsoft-DeployNotifierLogicApp", response.DataStore); Assert.IsTrue(response.IsSuccess); }
public override void OnTestInitialise() { var testMethod = TestContext.TestName; try { TestManager = ServiceTestManager.Instance(); TestManager.OnTestMethodInitialise(testMethod, TestContext); CustomAttributesInitialise(testMethod); } catch (Exception ex) { HandleException(ex); } }
public override void TryGetSetOtherContainerTest() { base.TryGetSetOtherContainerTest(); // Validate Assert.AreSame(LifetimeManager.NoValue, TestManager.TryGetValue(OtherContainer)); Assert.AreSame(LifetimeManager.NoValue, TestManager.GetValue(OtherContainer)); // Act TestManager.SetValue(TestObject, OtherContainer); // Validate Assert.AreSame(TestObject, TestManager.TryGetValue(OtherContainer)); Assert.AreSame(TestObject, TestManager.GetValue(OtherContainer)); }
private void lnkTypeDefault_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { if (DialogResult.Yes == MessageBox.Show("Are you sure you want to insert default values?", "Confirm Insert", MessageBoxButtons.YesNo, MessageBoxIcon.Question)) { foreach (Control ctrl in pnlParameters.Controls) { if (ctrl is ParameterCtrl) { ParameterCtrl pC = (ParameterCtrl)ctrl; pC.ParameterTextValue = TestManager.GetDefaultValueForSqlDbType(pC.DbType); pC.Parameter.Value = pC.ParameterTextValue; } } } }
public void AddAnswer_failed_if_no_changes_occured() { //arrange Mock <IUnitOfWork> uow = new Mock <IUnitOfWork>(); uow.Setup(u => u.SaveChanges()).ReturnsAsync(0); TestManager manager = new TestManager(uow.Object); //act var result = manager.AddAnswer(new Answer { }, _addQuestions[0]).Result; //assert Assert.False(result.Succeeded); }
protected override RunTestResponse HandleRequest(RunTestRequest request, TestManager testManager) { if (testManager.IsConnected) { return(testManager.RunTest(request.MethodName, request.TestFrameworkName, request.TargetFrameworkVersion)); } var response = new RunTestResponse { Failure = "Failed to connect to 'dotnet test' process", Pass = false }; return(response); }
private bool AddNewTestCaseFromScript(string script) { try { Dictionary <string, string> parameterList; string spName; TestManager.GetConfigurationFromScript(script, this.connData, out spName, out parameterList); this.testConfig.AddNewTestCase(spName, parameterList); return(true); } catch { return(false); } }
public string BuildCandlePatternDeals() { WekaUtils.Instance.WriteLog("Now BuildCandlePatternDeals"); var cp = TestParameters2.CandidateParameter; string resultFile = TestParameters.GetBaseFilePath(string.Format("IncrementTest_{0}_{1}_{2}.txt", cp.MainSymbol, "CandlePattern", cp.MainPeriod)); if (File.Exists(resultFile)) { return(string.Empty); } string txtFileName = TestParameters.GetBaseFilePath(string.Format("{0}_{1}_{2}.txt", cp.MainSymbol, "CandlePattern", cp.MainPeriod)); System.IO.File.Delete(txtFileName); if (!File.Exists(txtFileName)) { bool ret = GenerateCandlePatterns(txtFileName); if (!ret) { return(string.Empty); } } string arffFileName = TestParameters.GetBaseFilePath(string.Format("{0}_{1}_{2}.arff", cp.MainSymbol, "CandlePattern", cp.MainPeriod)); if (!System.IO.File.Exists(arffFileName)) { GenerateArff(arffFileName, txtFileName); } weka.core.Instances allInstances = WekaUtils.LoadInstances(arffFileName); //FilterInstances(allInstances); WekaUtils.SaveInstances(allInstances, arffFileName); int n = (int)(24 / TestParameters2.MainPeriodOfHour); n = TestParameters2.nPeriod; return(TestManager.IncrementTest(allInstances, () => { return WekaUtils.CreateClassifier(typeof(MinDistanceClassifier)); //return WekaUtils.CreateClassifier(typeof(weka.classifiers.lazy.IBk)); }, "1,2,3,4", resultFile, n)); }
public String ReturnView(String viewNumber, String view, String client, TestManager testdata, String deviceType) { string viewType = "base"; string partialView = String.Format("{0}{1}", viewNumber, view); foreach (var item in testdata.replacementList) { if (item.Find.ToLower() == view.ToLower()) { viewType = "replacements"; partialView = item.Replace; } } string returnView = String.Format("{0}/{1}/{2}", deviceType.ToLower(), viewType, partialView); return returnView; }
// Use this for initialization void Start() { Ritual = GetComponent<IRitual>(); m_Boredom = new Boredom(); m_Timer = new Timer(); m_ResetTimer = new Timer(); m_Agent = GetComponent<NavMeshAgent>(); ChildrenMask = LayerMask.GetMask("Child"); DistractableMask = LayerMask.GetMask("Distractables"); Manager = GameObject.FindGameObjectWithTag("Manager").GetComponent<TestManager>(); Manager.m_RitualManager.RegisterChild(this); InitState(ChildState.Free); }
public static TestRunProxy TestRunModelToProxy(TestRun run) { TestRunProxy runProxy = new TestRunProxy(); runProxy.ID = run.ID; runProxy.Name = run.Name; runProxy.CreatedBy = run.CreatedBy; runProxy.CreatedOn = run.CreatedOn; IEnumerable<TestComposite> compositeModel = new TestRunManager().GetCompositeByRunId(runProxy.ID); foreach (TestComposite comp in compositeModel) { ExtendedTestCaseProxy extendedTestCaseProxy = new ExtendedTestCaseProxy(); extendedTestCaseProxy.Status = EnumUtil.ParseEnum<Status>(comp.TestCaseStatus); TestCase testCase = new TestManager().GetById(comp.TestCaseID); extendedTestCaseProxy.Id = testCase.ID; extendedTestCaseProxy.Title = testCase.Title; extendedTestCaseProxy.Priority = EnumUtil.ParseEnum<Priority>(testCase.Priority); extendedTestCaseProxy.Severity = EnumUtil.ParseEnum<Severity>(testCase.Severity); extendedTestCaseProxy.IsAutomated = testCase.IsAutomated; extendedTestCaseProxy.CreatedBy = testCase.CreatedBy; extendedTestCaseProxy.UpdatedBy = testCase.UpdatedBy; extendedTestCaseProxy.AreaID = testCase.AreaID; foreach (var item in new TestManager().GetStepDefinitionsById(testCase.ID)) { StepDefinitionProxy proxy = new StepDefinitionProxy(); proxy.Step = item.Step; proxy.ExpectedResult = item.ExpectedResult; proxy.ID = item.ID; proxy.TestCaseID = item.TestCaseID; extendedTestCaseProxy.StepDefinitionList.Add(proxy); } runProxy.TestCasesList.Add(extendedTestCaseProxy); } return runProxy; }
public ActionResult Index() { //--- get domain from url ---// string domain = Request.Url.Authority.ToLower(); string viewType = "base"; //-- Check for test. Moved to here till render enguine can be corrected. JL 7/25/12 ---- String testview = "Index"; //-- Check the device type for desktop or mobile ----- int deviceType = GetDevice(System.Web.HttpContext.Current.Request, false); //-- for testing true (desktop), false (mobile) //-- Step 1 get test information based off of the url TestManager testData = new TestManager(System.Web.HttpContext.Current.Request, deviceType); if (!testData.variationsData.Base) viewType = "replacements"; //ViewData["DeviceType"] = getDevice(Request); ViewData["DeviceType"] = "desktop"; //-- Set default Master View (_Layout) -- ViewData["LayoutPage"] = testData.variationsData.TemplateName; ViewData["Client"] = "trugreen"; ViewData["ViewType"] = viewType; ViewData["ViewName"] = testData.variationsData.ViewName; ViewData["ViewNumber"] = testData.variationsData.ViewName.Substring(2); testview = testData.variationsData.ViewName; return View(testview.ToLower(), testData); }
private bool AddTest(TestManager parent, TestConfig testConfig) { TestBase test = null; var timeInterval = GetFromTemplate(testConfig.TimeIntervalTemplate, _id); int ti = 0; Int32.TryParse(timeInterval, out ti); testConfig.TimeInterval = ti; switch (testConfig.GetType().Name) { case "LoopConfig": var cfgLoop = testConfig as LoopConfig; test = new TestManager(testConfig.Name) { StartCondition = cfgLoop.StartCondition, Delay = cfgLoop.TimeInterval, Iterations = cfgLoop.Iterations, StopOnError = cfgLoop.StopOnError, NotifyWhenIterationFinished = cfgLoop.NotifyWhenIterationFinished, StatisticsGatherer = ClientStatisticsGatherer }; cfgLoop.Tests.ForEach(d=>AddTest(test as TestManager, d)); break; case "LoginTestConfig": var cfgLogin = testConfig as LoginTestConfig; _login = GetFromTemplate(cfgLogin.LoginTemplate, _id); TestStaticDataMng.Register(_login); var passwd = CreatePassword(_login); test = new LoginTest(_login, passwd) { StartCondition = cfgLogin.StartCondition, Delay = cfgLogin.TimeInterval, StatisticsGatherer = ClientStatisticsGatherer }; break; case "TotalCardListTestConfig": var cfgTotalCardListTest = testConfig as TotalCardListTestConfig; test = new TotalCardListTest(cfgTotalCardListTest.NumItemsOnPage) { StartCondition = cfgTotalCardListTest.StartCondition,Delay = cfgTotalCardListTest.TimeInterval, StatisticsGatherer = ClientStatisticsGatherer }; break; case "RelevantCardListTestConfig": var cfgRelevantCardListTest = testConfig as RelevantCardListTestConfig; test = new RelevantCardListTest(cfgRelevantCardListTest.NumItemsOnPage) { StartCondition = cfgRelevantCardListTest.StartCondition,Delay = cfgRelevantCardListTest.TimeInterval, StatisticsGatherer = ClientStatisticsGatherer }; break; case "IncidentTypeChoiceTestConfig": var cfgIncidentTypeChoice = testConfig as IncidentTypeChoiceTestConfig; test = new IncidentTypeChoiceTest(cfgIncidentTypeChoice.IncidentTypeName, cfgIncidentTypeChoice.NumItemsOnPage) { StartCondition = cfgIncidentTypeChoice.StartCondition, Delay = cfgIncidentTypeChoice.TimeInterval, StatisticsGatherer = ClientStatisticsGatherer }; break; case "LogoutTestConfig": var cfgLogout = testConfig as LogoutTestConfig; test = new LogoutTest { StartCondition = cfgLogout.StartCondition, Delay = cfgLogout.TimeInterval, StatisticsGatherer = ClientStatisticsGatherer }; break; case "CardListTestConfig": var cfgCardList = testConfig as CardListTestConfig; test = new CardListTest(cfgCardList.NumberOfPageChanging, ClientStatisticsGatherer) { StartCondition = cfgCardList.StartCondition, Delay = cfgCardList.TimeInterval }; break; case "CardTestConfig": var cfgCard = testConfig as CardTestConfig; test = new CardTest(ClientStatisticsGatherer) { StartCondition = cfgCard.StartCondition, Delay = cfgCard.TimeInterval, }; cfgCard.Tests.ForEach(d => AddTest(test as TestManager, d)); break; case "CardSaveTestConfig": var cfgSave = testConfig as CardSaveTestConfig; if (!(parent is CardTest)) return false; test = new SaveCard(parent as CardTest, cfgSave) { StartCondition = cfgSave.StartCondition, Delay = cfgSave.TimeInterval, StatisticsGatherer = ClientStatisticsGatherer }; break; case "CardCloseTestConfig": var cfgClose = testConfig as CardCloseTestConfig; if (!(parent is CardTest)) return false; test = new CloseCard(cfgClose.CallsToCard, parent as CardTest ) { StartCondition = cfgClose.StartCondition, Delay = cfgClose.TimeInterval, StatisticsGatherer = ClientStatisticsGatherer }; break; case "WaitCallConfig": var wcCfg = testConfig as WaitCallConfig; test = new WaitCall(wcCfg.CallCommitCondition, wcCfg.CommitPause, wcCfg.AcceptCalls, wcCfg.RejectCalls, wcCfg.NoAnswer, Data) { StartCondition = wcCfg.StartCondition, Delay = wcCfg.TimeInterval, StatisticsGatherer = ClientStatisticsGatherer }; break; } if (parent == null) { _testMng = test as TestManager; } else { parent.AddTest(test); } return true; }
// Use this for initialization void Start() { m_Manager = GameObject.FindGameObjectWithTag("Manager").GetComponent<TestManager>(); }
public void TestThatFindingAnElementWithAShortTimeoutThrowsAnExceptionInFirefox() { tm = new TestManager("Firefox"); tm.Browser.Navigate().GoToPage(tm.Pages.Home); tm.Pages.Home.SearchBox.SendKeys("Cheese"); tm.Pages.Home.SearchButton.Click(); var expectedResultItem = tm.Browser.FindElement(By.XPath("//li/div/span/h3/a[contains(text(), 'British')]"), 1); Assert.IsNotNull(expectedResultItem, "The expected result item was not found."); }
public async Task RunStartThrows() { var coordinator = Substitute.For<ICoordinator>(); coordinator.PeriodInSeconds.Returns(100000); coordinator.Check(Arg.Any<Type>()).Returns(Task.FromResult(true)); coordinator.When(c => c.Start(Arg.Any<Type>(), Arg.Any<Guid>(), Arg.Any<DateTime>())).Do(x => { throw new Exception(); }); coordinator.Complete(Arg.Any<Type>(), Arg.Any<Guid>(), Arg.Any<DateTime>(), Arg.Any<DateTime>(), Arg.Any<bool>()); using (var m = new TestManager(coordinator)) { await m.RunAsync(); } coordinator.Received().Check(Arg.Any<Type>()); coordinator.Received().Start(Arg.Any<Type>(), Arg.Any<Guid>(), Arg.Any<DateTime>()); coordinator.DidNotReceive().Complete(Arg.Any<Type>(), Arg.Any<Guid>(), Arg.Any<DateTime>(), Arg.Any<DateTime>(), Arg.Any<bool>()); }
private void NavigateToNullPage() { tm = new TestManager(); tm.Browser.Navigate().GoToPage(null); }
public void TestThatICanSuspendCodeExecutionForAGivenTimePeriod() { tm = new TestManager(new Mock<IWebDriver>().Object); threadSleepCompleted = false; TimerCallback tcb = TimerComplete; // ReSharper disable once UnusedVariable var threadTimer = new Timer(tcb, null, 0, 11000); // Do a vague test to check that the period is roughly correct. tm.Browser.Wait(10000); threadSleepCompleted = true; }
public void TestThatICanObtainAWebDriverInstanceFromADescriptiveBrowserString(string browserName, string objectType) { tm = new TestManager(browserName); Assert.AreEqual(objectType, tm.Browser.GetType().ToString()); }
public void TestThatFindingAnElementWithNoCriteriaThrowsAnArgumentNullException() { tm = new TestManager(); tm.Browser.Navigate().GoToPage(tm.Pages.Home); var anex = Assert.Throws(typeof(ArgumentNullException), () => tm.Browser.FindElement(null, 1)) as ArgumentNullException; Assert.IsNotNull(anex); Assert.AreEqual("elementSearchDefinition", anex.ParamName, "The invalid parameter name should be 'elementSearchDefinition'"); }
private void CreateTestCase(object sender, RoutedEventArgs e) { this.TestCaseTitleValidation(this.TestCaseTitle.Text); if (!string.IsNullOrWhiteSpace(this.TestCaseTitle.Text)) { TestCaseProxy testCase = new TestCaseProxy(); testCase.Id = this.testCaseId; testCase.Title = this.TestCaseTitle.Text; testCase.Priority = EnumUtil.ParseEnum<Priority>((this.PriorityComboBox.SelectedItem as ComboBoxItem).Content.ToString()); testCase.Severity = EnumUtil.ParseEnum<Severity>((this.SeverityComboBox.SelectedItem as ComboBoxItem).Content.ToString()); testCase.IsAutomated = this.IsAutomatedCheckBox.IsChecked ?? false; testCase.StepDefinitionList = new ObservableCollection<StepDefinitionProxy>(); foreach (var item in this.TestStepList.ItemsSource) { StepDefinitionProxy stepDefinition = new StepDefinitionProxy(); stepDefinition.ID = (item as StepDefinitionProxy).ID; stepDefinition.Step = (item as StepDefinitionProxy).Step; stepDefinition.ExpectedResult = (item as StepDefinitionProxy).ExpectedResult; stepDefinition.TestCaseID = testCase.Id; testCase.StepDefinitionList.Add(stepDefinition); } TestManager manager = new TestManager(); if (!this.isEditingExistingTestCase) { TestCaseDialog.testCase = ProxyConverter.TestCaseModelToProxy(manager.Create(relatedArea.ID, ModelConverter.TestCaseProxyToModel(testCase))); } else { TestCaseDialog.testCase = ProxyConverter.TestCaseModelToProxy(manager.Update(ModelConverter.TestCaseProxyToModel(testCase))); } this.CancelDialog(); } }
public async Task Run() { var coordinator = Substitute.For<ICoordinator>(); coordinator.PeriodInSeconds.Returns(100000); coordinator.Check(Arg.Any<Type>()).Returns(Task.FromResult(true)); coordinator.Start(Arg.Any<Type>(), Arg.Any<Guid>(), Arg.Any<DateTime>()).Returns(Task.FromResult(0)); coordinator.Complete(Arg.Any<Type>(), Arg.Any<Guid>(), Arg.Any<DateTime>(), Arg.Any<DateTime>(), true).Returns(Task.FromResult(0)); using (var m = new TestManager(coordinator)) { await m.RunAsync(); } coordinator.Received().Check(Arg.Any<Type>()); coordinator.Received().Start(Arg.Any<Type>(), Arg.Any<Guid>(), Arg.Any<DateTime>()); coordinator.Received().Complete(Arg.Any<Type>(), Arg.Any<Guid>(), Arg.Any<DateTime>(), Arg.Any<DateTime>(), true); }
private void DeleteTestCase(object sender, RoutedEventArgs e) { TestCaseProxy testCaseToDelete = ((MenuItem)sender).DataContext as TestCaseProxy; TestManager manager = new TestManager(); manager.DeleteById(testCaseToDelete.Id); ProjectProxy projectProxy = this.UIProjectProxyList.Where(proj => proj.Areas.Any(a => a.ID == testCaseToDelete.AreaID)).FirstOrDefault(); if (projectProxy != null) { AreaProxy areaProxy = projectProxy.Areas.Where(a => a.ID == testCaseToDelete.AreaID).FirstOrDefault(); if (areaProxy != null) { areaProxy.TestCasesList.Remove(testCaseToDelete); this.SetCurrentTestCase(new TestCaseProxy()); } } }
public void SetUp() { tm = new TestManager(browserName); }
void Awake () { Instance = this; }