예제 #1
0
        public static void ShouldHaveRuntimeStatus(this ICommandResult commandResult, CommandRuntimeStatus runtimeStatus)
        {
            if (commandResult is null)
            {
                throw new ArgumentNullException(nameof(commandResult));
            }

            var message = new StringBuilder();

            message.AppendLine($"Runtime Status is not '{runtimeStatus}' but '{commandResult.RuntimeStatus}'");

            foreach (var error in commandResult.Errors)
            {
                if (error == commandResult.Errors.First())
                {
                    message.AppendLine("Errors:");
                }

                message.Append($"- [{error.Severity}] {error.Message}");
            }

            Assert.True(commandResult.RuntimeStatus == runtimeStatus, message.ToString());
        }
예제 #2
0
 public static bool IsUnknown(this CommandRuntimeStatus status)
 => status == CommandRuntimeStatus.Unknown;
예제 #3
0
 public static bool IsActive(this CommandRuntimeStatus status)
 => status == CommandRuntimeStatus.ContinuedAsNew ||
 status == CommandRuntimeStatus.Pending ||
 status == CommandRuntimeStatus.Running;
예제 #4
0
 public static bool IsFinal(this CommandRuntimeStatus status)
 => status == CommandRuntimeStatus.Canceled ||
 status == CommandRuntimeStatus.Completed ||
 status == CommandRuntimeStatus.Failed ||
 status == CommandRuntimeStatus.Terminated;