mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 02:36:19 +02:00
Fix autocomplete text issue on query change (#7392)
* Fix autocomplete text issue on query change * Update from invariant to ordinal case for exact byte to byte matching * Add tests for checking when autocomplete should be empty
This commit is contained in:
committed by
GitHub
parent
0314b570cd
commit
466ed10f3d
@@ -207,5 +207,61 @@ namespace Wox.Test
|
||||
// Assert
|
||||
Assert.AreEqual(input, autoCompleteText);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ShouldAutoCompleteTextBeEmpty_ShouldReturnFalse_WhenAutoCompleteTextIsEmpty()
|
||||
{
|
||||
// Arrange
|
||||
string queryText = "Te";
|
||||
string autoCompleteText = string.Empty;
|
||||
|
||||
// Act
|
||||
bool result = MainViewModel.ShouldAutoCompleteTextBeEmpty(queryText, autoCompleteText);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(false, result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ShouldAutoCompleteTextBeEmpty_ShouldReturnTrue_WhenQueryTextMatchAutoCompleteText()
|
||||
{
|
||||
// Arrange
|
||||
string queryText = "Te";
|
||||
string autoCompleteText = "Teams";
|
||||
|
||||
// Act
|
||||
bool result = MainViewModel.ShouldAutoCompleteTextBeEmpty(queryText, autoCompleteText);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(false, result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ShouldAutoCompleteTextBeEmpty_ShouldReturnTrue_WhenQueryTextIsEmpty()
|
||||
{
|
||||
// Arrange
|
||||
string queryText = string.Empty;
|
||||
string autoCompleteText = "Teams";
|
||||
|
||||
// Act
|
||||
bool result = MainViewModel.ShouldAutoCompleteTextBeEmpty(queryText, autoCompleteText);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(true, result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ShouldAutoCompleteTextBeEmpty_ShouldReturnTrue_WhenQueryTextDoesNotMatchAutoCompleteText()
|
||||
{
|
||||
// Arrange
|
||||
string queryText = "TE";
|
||||
string autoCompleteText = "Teams";
|
||||
|
||||
// Act
|
||||
bool result = MainViewModel.ShouldAutoCompleteTextBeEmpty(queryText, autoCompleteText);
|
||||
|
||||
// Assert
|
||||
Assert.AreEqual(true, result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user