public void TestOnLocateCompleteWhenResultIsNullDoesNothing() { var settingHelper = new Mock <ISettingHelper>(MockBehavior.Strict); var helper = new Mock <IScenarioContextHelper>(MockBehavior.Strict); var highlightAction = new HighlightLocatorAction(helper.Object, settingHelper.Object); highlightAction.OnLocateComplete("MyProperty", null); helper.VerifyAll(); settingHelper.VerifyAll(); }
public void TestOnLocateCompleteWhenSettingIsEnabledHighlightsElement() { var settingHelper = new Mock <ISettingHelper>(MockBehavior.Strict); settingHelper.SetupGet(s => s.HighlightModeEnabled).Returns(true); var helper = new Mock <IScenarioContextHelper>(MockBehavior.Strict); var propertyData = new Mock <IPropertyData>(MockBehavior.Strict); propertyData.Setup(p => p.Highlight()); var highlightAction = new HighlightLocatorAction(helper.Object, settingHelper.Object); highlightAction.OnLocateComplete("MyProperty", propertyData.Object); helper.VerifyAll(); propertyData.VerifyAll(); settingHelper.VerifyAll(); }
public void TestOnLocateCompleteWhenSettingIsDisabledAndContextAreOffDoesNothing() { var settingHelper = new Mock <ISettingHelper>(MockBehavior.Strict); settingHelper.SetupGet(s => s.HighlightModeEnabled).Returns(false); var helper = new Mock <IScenarioContextHelper>(MockBehavior.Strict); helper.Setup(h => h.ContainsTag(HighlightLocatorAction.HighlightMode)).Returns(false); helper.Setup(h => h.FeatureContainsTag(HighlightLocatorAction.HighlightMode)).Returns(false); var propertyData = new Mock <IPropertyData>(MockBehavior.Strict); var highlightAction = new HighlightLocatorAction(helper.Object, settingHelper.Object); highlightAction.OnLocateComplete("MyProperty", propertyData.Object); helper.VerifyAll(); propertyData.VerifyAll(); settingHelper.VerifyAll(); }