Skip to content

Extends Verify to allow verification of CommunityToolkit.Mvvm.

License

Notifications You must be signed in to change notification settings

VerifyTests/Verify.CommunityToolkit.Mvvm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Extends Verify to allow verification of CommunityToolkit.Mvvm.

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

 

Languages