Skip to content

Assert your MediatR configuration in any test framework like XUnit , NUnit , MsUnit , ...develop Creative Codes with Ershad Raoufi / ارشاد رئوفی

Notifications You must be signed in to change notification settings

Ershad95/MediatR.Assert

Repository files navigation

MediatR.Assert

Project Description

Assert MediatR configuration in any test framework like XUnit , NUnit , MsUnit,...developed Creative Codes with Ershad Raoufi/ارشاد رئوفی

Overview

CommandValidator usage : you should create object from CommandValidator for Asser Commands,for example :

 var validCommandConfiguration = new CommandValidator().IsValid();

QueryValidator usage : you should create object from QueryValidator for Asser Queries,for example :

var validQueryConfiguration = new QueryValidator().IsValid();

NotificationValidator usage : you should create object from NotificationValidator for Asser Notifications,for example :

 var validNotificationConfiguration = new NotificationValidator().IsValid();

Customization

Commands

you can pass the custom name for command/commandHandler: the default value for CommandName and Handler are : "Command" and "CommandHandler" but you can custom it by bellow code:

var validCommandConfiguration = new CommandValidator()
                                   .IsValid(commandNamesEndTo : "something" , 
                                   commandHandlersEndTo : "something");

Query

you can pass the custom name for query/queryHandler: the default value for QueryName and Handler are : "Query" and "QueryHandler" but you can custom it by bellow code :

var validQueryConfiguration = new QueryValidator()
                                  .IsValid(queryNamesEndTo : "something" , 
                                  queryHandlersEndTo : "something");

Notification

you can pass the custom name for notification/notificationHandler: the default value for NotificationName and Handler are : "Notification" and "NotificationHandler" but you can custom it by bellow code :

  var validNotificationConfiguration = new NotificationValidator()
                                 .IsValid(notificationNamesEndTo : "something" , 
                                 notificationHandlerNamesEndTo : "something");
 

just for Persian Developer : https://dntips.ir/post/3436

About

Assert your MediatR configuration in any test framework like XUnit , NUnit , MsUnit , ...develop Creative Codes with Ershad Raoufi / ارشاد رئوفی

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages