Beispiel #1
0
 public static void IsSuccessful(CommandResult commandResult)
 {
     if (commandResult.IsFailure)
     {
         Assert.Fail($"The commandResult is not successful: {commandResult.ErrorMessage}");
     }
 }
Beispiel #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.");
            }
        }
Beispiel #3
0
 internal static CommandResult FromError(string errorMessage)
 {
     var commandResult = new CommandResult(false);
     commandResult.SetToError(errorMessage);
     return commandResult;
 }
Beispiel #4
0
 internal static CommandResult FromError(Exception exception)
 {
     var commandResult = new CommandResult(false);
     commandResult.SetToError(exception);
     return commandResult;
 }