mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 18:57:19 +02:00
Tooltip for indexer and program plugin (#4589)
* Fix multiline title issue * Added code to display tooltip for program and indexer plugin * Added tests for Result class * Theme based color for tooltip * Added colors for tooltip * Added string tags to tooltip * Add initial show delay * Seperated textbox for title and path
This commit is contained in:
committed by
GitHub
parent
1533c9315f
commit
8d72bc0ea4
37
src/modules/launcher/Wox.Test/Plugins/ResultTest.cs
Normal file
37
src/modules/launcher/Wox.Test/Plugins/ResultTest.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using NUnit.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using Wox.Plugin;
|
||||
|
||||
namespace Wox.Test.Plugins
|
||||
{
|
||||
[TestFixture]
|
||||
class ResultTest
|
||||
{
|
||||
[Test]
|
||||
public void Result_UpdatesToolTipVisibilityToVisible_WhenToolTipDataIsSet()
|
||||
{
|
||||
// Arrange
|
||||
Result res = new Result();
|
||||
string toolTipText = "ToolTipText";
|
||||
|
||||
// Act
|
||||
res.ToolTipData = new ToolTipData(toolTipText, string.Empty);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(res.ToolTipVisibility, Visibility.Visible);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Result_UpdatesToolTipVisibilityToCollapsed_WhenToolTipDataIsNotSet()
|
||||
{
|
||||
// Act
|
||||
Result res = new Result();
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(res.ToolTipVisibility, Visibility.Collapsed);
|
||||
}
|
||||
}
|
||||
}
|
||||
23
src/modules/launcher/Wox.Test/Plugins/ToolTipDataTest.cs
Normal file
23
src/modules/launcher/Wox.Test/Plugins/ToolTipDataTest.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using NUnit.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Wox.Plugin;
|
||||
|
||||
namespace Wox.Test.Plugins
|
||||
{
|
||||
[TestFixture]
|
||||
class ToolTipDataTest
|
||||
{
|
||||
[Test]
|
||||
public void Constructor_ThrowsNullArgumentException_WhenToolTipTitleIsNull()
|
||||
{
|
||||
// Arrange
|
||||
string title = null;
|
||||
string text = "text";
|
||||
|
||||
// Assert
|
||||
var ex = Assert.Throws<ArgumentException>(() => new ToolTipData(title, text));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user