Exemple #1
0
 public static void IsSuccessful(CommandResult commandResult)
 {
     if (commandResult.IsFailure)
     {
         Assert.Fail($"The commandResult is not successful: {commandResult.ErrorMessage}");
     }
 }
Exemple #2
0
        public static void IsFailure(CommandResult commandResult)
        {
            if (commandResult.IsFailure && commandResult.Exception is Moq.MockException)
            {
                Assert.Fail($"The command failed because of an mock exception: {commandResult.Exception.Message}");
            }

            if (commandResult.IsSuccess)
            {
                Assert.Fail("The commandResult should signal an failed execution, but is instead successful.");
            }
        }
Exemple #3
0
 internal static CommandResult FromError(string errorMessage)
 {
     var commandResult = new CommandResult(false);
     commandResult.SetToError(errorMessage);
     return commandResult;
 }
Exemple #4
0
 internal static CommandResult FromError(Exception exception)
 {
     var commandResult = new CommandResult(false);
     commandResult.SetToError(exception);
     return commandResult;
 }