https://github.com/verifytests/verify.communitytoolkit.mvvm
Extends Verify to allow verification of CommunityToolkit.Mvvm.
https://github.com/verifytests/verify.communitytoolkit.mvvm
Last synced: 8 months ago
JSON representation
Extends Verify to allow verification of CommunityToolkit.Mvvm.
- Host: GitHub
- URL: https://github.com/verifytests/verify.communitytoolkit.mvvm
- Owner: VerifyTests
- License: mit
- Created: 2023-08-23T06:51:20.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-04-29T17:37:56.000Z (about 2 years ago)
- Last Synced: 2024-05-01T09:37:51.640Z (about 2 years ago)
- Language: C#
- Homepage:
- Size: 191 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Funding: .github/FUNDING.yml
- License: license.txt
- Code of conduct: code_of_conduct.md
Awesome Lists containing this project
README
#
Verify.CommunityToolkit.Mvvm
[](https://github.com/orgs/VerifyTests/discussions)
[](https://ci.appveyor.com/project/SimonCropp/verify-communitytoolkit-mvvm)
[](https://www.nuget.org/packages/Verify.CommunityToolkit.Mvvm/)
Extends [Verify](https://github.com/VerifyTests/Verify) to allow verification of [CommunityToolkit.Mvvm](https://learn.microsoft.com/en-us/dotnet/communitytoolkit/mvvm/).
## Sponsors
### Entity Framework Extensions
[Entity Framework Extensions](https://entityframework-extensions.net/?utm_source=simoncropp&utm_medium=Verify.CommunityToolkit.Mvvm) is a major sponsor and is proud to contribute to the development this project.
[](https://entityframework-extensions.net/?utm_source=simoncropp&utm_medium=Verify.CommunityToolkit.Mvvm)
## NuGet
* https://nuget.org/packages/Verify.CommunityToolkit.Mvvm
## Usage
```cs
[ModuleInitializer]
public static void Initialize() =>
VerifyCommunityToolkitMvvm.Initialize();
```
snippet source | anchor
### RelayCommand
```cs
[Fact]
public Task RelayCommand()
{
var content = new RelayCommand(ActionMethod, CanExecuteMethod);
return Verify(content);
}
```
snippet source | anchor
Results in:
```txt
{
Execute: Tests.ActionMethod,
CanExecute: Tests.CanExecuteMethod
}
```
snippet source | anchor
### AsyncRelayCommand
```cs
[Fact]
public Task AsyncRelayCommand()
{
var content = new AsyncRelayCommand(ActionMethodAsync, CanExecuteMethod);
return Verify(content);
}
```
snippet source | anchor
Results in:
```txt
{
Execute: Tests.ActionMethodAsync,
CanExecute: Tests.CanExecuteMethod
}
```
snippet source | anchor