private void HoverLight_ValidatePointerOverState() { if (!ValidateEffectsPresent()) { return; } using (var logger = new ResultsLogger("PointerOver", TestResult)) { string targetText = TargetComboBox.GetSelectedText(); Control target = FindName(targetText) as Control; // It is more complex to validate Reveal hover brush targeting on ListViewItem // since it uses several brushes applied to the internal ListViewItemChrome. Skip the check here. bool lightTargetingResult = true; if (targetText != "NormalListViewItem") { RevealBrush revealHoverBrush = target.Background as RevealBrush; lightTargetingResult = VerifyHoverBrushTargeting(revealHoverBrush); } logger.Verify(lightTargetingResult, "lightTargetingResult:" + lightTargetingResult); var lights = GetElementForHoverLight(target).Lights; bool lightCountResult = lights.Count == 2; // Reveal Press light is also present logger.Verify(lightCountResult, "lightCountResult:" + lightCountResult); var hoverLight = _revealTestApi.GetAsRevealHoverLight(lights[0]); logger.Verify(hoverLight != null, "HoverLight should be non-null"); bool lightValidationResult = HoverLight_ValidatePointerOver(hoverLight); logger.Verify(lightValidationResult, "lightValidationResult: " + lightValidationResult); } }
private void FillTargetServerComboBox() { DataTable DSTasksDataTable = RestrServers(); TargetComboBox.DataSource = DSTasksDataTable; TargetComboBox.TextField = "ServerName"; TargetComboBox.ValueField = "ID"; TargetComboBox.DataBind(); }
private void HoverLight_ValidateNormalState() { if (!ValidateEffectsPresent()) { return; } using (var logger = new ResultsLogger("Normal", TestResult)) { if (_normalStateCheckNumber < 1 || _normalStateCheckNumber > 2) { logger.LogError("Error: unpexected call to HoverLight_ValidateNormalState"); return; } bool isInitialCheck = _normalStateCheckNumber == 1; _normalStateCheckNumber++; string targetText = TargetComboBox.GetSelectedText(); Control target = FindName(targetText) as Control; // It is more complex to validate Reveal hover bursh targeting on ListViewItem // since it uses several brushes applied to the internal ListViewItemChrome. Skip the check here. bool lightTargetingResult = true; if (targetText != "NormalListViewItem") { RevealBrush revealHoverBrush = target.Background as RevealBrush; lightTargetingResult = VerifyHoverBrushTargeting(revealHoverBrush); } logger.Verify(lightTargetingResult, "lightTargetingResult:" + lightTargetingResult); var lights = GetElementForHoverLight(target).Lights; // No lights expected if we've never hovered over this Button bool lightCountResult = isInitialCheck ? lights.Count == 0 : lights.Count == 2; logger.Verify(lightCountResult, "lightCountResult:" + lightCountResult); bool lightValidationResult = true; // If we have hovered over the target, validate Reveal light is properly in normal state if (!isInitialCheck) { var hoverLight = _revealTestApi.GetAsRevealHoverLight(lights[0]); lightValidationResult = HoverLight_ValidateNormal(hoverLight); } logger.Verify(lightValidationResult, "lightValidationResult: " + lightValidationResult); } }