public void Init_InitPopupContents_SetsPopupContentsValues(bool isEmptyId) { // Arrange var usePopupOnClickSet = false; ShimToolButton.AllInstances.UsePopupOnClickSetBoolean = (obj, value) => usePopupOnClickSet = value; Editor.indexTools = 0; // Act using (var testObject = new ToolReplace(isEmptyId ? string.Empty : TestValue)) { // Assert testObject.ShouldSatisfyAllConditions( () => testObject.ID.ShouldBe(isEmptyId ? ToolReplaceId : TestValue), () => testObject.PopupContents.ID.ShouldBe(isEmptyId ? ToolReplaceId + nameof(Popup) : TestValue + nameof(Popup)), () => TestsHelper.AssertNotFX1(string.Empty, testObject.ImageURL), () => TestsHelper.AssertNotFX1(string.Empty, testObject.OverImageURL), () => TestsHelper.AssertFX1(ReplaceOffImage, testObject.ImageURL), () => TestsHelper.AssertFX1(ReplaceOverImage, testObject.OverImageURL), () => testObject.ToolTip.ShouldBe(TitleText), () => usePopupOnClickSet.ShouldBeTrue(), () => testObject.PopupContents.Height.ShouldBe(165), () => testObject.PopupContents.Width.ShouldBe(325), () => testObject.PopupContents.TitleText.ShouldBe(TitleText), () => testObject.PopupContents.ShowShadow.ShouldBeFalse()); } }
public void Apply_EditorWithDifferentTools_SetsCorrectPopupContentTitleText() { // Arrange var toolbar = _editor.Toolbars.Toolbars[0]; var toolSpellChecker = new ToolSpellChecker(); toolbar.Tools.Add(toolSpellChecker); var toolFind = new ToolFind(); toolbar.Tools.Add(toolFind); var toolReplace = new ToolReplace(); toolbar.Tools.Add(toolReplace); var toolImage = new ToolImage(); toolbar.Tools.Add(toolImage); var toolLink = new ToolLink(); toolbar.Tools.Add(toolLink); var toolFlash = new ToolFlash(); toolbar.Tools.Add(toolFlash); // Arrange & Act LocalizationHelper.Apply(_localizationSettings, _editor); // Assert _editor.ShouldSatisfyAllConditions( () => _editor.ShouldNotBeNull(), () => toolSpellChecker.PopupContents.TitleText.ShouldBe(LocalizedTextId.TOOL_SPELL_CHECKER_TITLE), () => toolFind.PopupContents.TitleText.ShouldBe(LocalizedTextId.TOOL_FIND_TITLE), () => toolReplace.PopupContents.TitleText.ShouldBe(LocalizedTextId.TOOL_REPLACE_TITLE), () => toolImage.PopupContents.TitleText.ShouldBe(LocalizedTextId.TOOL_IMAGE_TITLE), () => toolLink.PopupContents.TitleText.ShouldBe(LocalizedTextId.TOOL_LINK_TITLE), () => toolFlash.PopupContents.TitleText.ShouldBe(LocalizedTextId.TOOL_FLASH_TITLE)); }