Skip to content

Latest commit

 

History

History
82 lines (65 loc) · 2.81 KB

readme.md

File metadata and controls

82 lines (65 loc) · 2.81 KB

Verify.CommunityToolkit.Mvvm

Discussions Build status NuGet Status

Extends Verify to allow verification of CommunityToolkit.Mvvm.

NuGet package

https://nuget.org/packages/Verify.CommunityToolkit.Mvvm/

Usage

[ModuleInitializer]
public static void Initialize() =>
    VerifyCommunityToolkitMvvm.Initialize();

snippet source | anchor

RelayCommand

[Fact]
public Task RelayCommand()
{
    var content = new RelayCommand(ActionMethod, CanExecuteMethod);
    return Verify(content);
}

snippet source | anchor

Results in:

{
  Execute: Tests.ActionMethod(),
  CanExecute: Tests.CanExecuteMethod()
}

snippet source | anchor

AsyncRelayCommand

[Fact]
public Task AsyncRelayCommand()
{
    var content = new AsyncRelayCommand(ActionMethodAsync, CanExecuteMethod);
    return Verify(content);
}

snippet source | anchor

Results in:

{
  Execute: Tests.ActionMethodAsync(),
  CanExecute: Tests.CanExecuteMethod()
}

snippet source | anchor