NAudioEngine is a singleton class how to write the can execute in the following code snippet:
private bool CanAddNew(object parameter)
{
if (NAudioEngine.Instance.SelectionEnd.Milliseconds != 0)
{
return true;
}
return false;
}
[Test]
public void AddNewCommandMainVMTestTrue()
{
MainVm mainVM = new MainVm();
RelayCommand command = (RelayCommand)mainVM.AddNewCommand;
bool canAddNew = command.CanExecute(null);
Assert.IsTrue(canAddNew);
}
Aucun commentaire:
Enregistrer un commentaire