mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 11:46:30 +02:00
Getting remaining Tests on stylecop (#5846)
This commit is contained in:
@@ -2,35 +2,36 @@
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Windows.Input;
|
||||
using NUnit.Framework;
|
||||
using Wox.Plugin;
|
||||
using PowerLauncher.ViewModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Wox.Plugin;
|
||||
|
||||
namespace Wox.Test
|
||||
{
|
||||
[TestFixture]
|
||||
public class Wox
|
||||
public class WoxTest
|
||||
{
|
||||
// A Dummy class to test that OnPropertyChanged() is called while we set the variable
|
||||
public class DummyTestClass : BaseModel
|
||||
{
|
||||
public bool isFunctionCalled = false;
|
||||
public bool IsFunctionCalled { get; set; } = false;
|
||||
|
||||
private ICommand _item;
|
||||
|
||||
public ICommand Item
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._item;
|
||||
return _item;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
if (value != this._item)
|
||||
if (value != _item)
|
||||
{
|
||||
this._item = value;
|
||||
_item = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
@@ -39,7 +40,7 @@ namespace Wox.Test
|
||||
// Overriding the OnPropertyChanged() function to test if it is being called
|
||||
protected override void OnPropertyChanged([CallerMemberName] string propertyName = null)
|
||||
{
|
||||
isFunctionCalled = true;
|
||||
IsFunctionCalled = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +54,7 @@ namespace Wox.Test
|
||||
testClass.Item = new RelayCommand(null);
|
||||
|
||||
// Assert
|
||||
Assert.IsTrue(testClass.isFunctionCalled);
|
||||
Assert.IsTrue(testClass.IsFunctionCalled);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user