Esempio n. 1
0
        public void ValidationFailed_WithCollectionOfErrors_ReturnResultWithSameInternalErrors()
        {
            var executionErrors = new[]
            {
                new ExecutionError(new ErrorCodeInfo(nameof(Core), FixtureUtils.String(), FixtureUtils.String())),
                new ExecutionError(new ErrorCodeInfo(nameof(Core), FixtureUtils.String(), FixtureUtils.String()))
            };

            var result = FailedResult.ValidationFailed(executionErrors);

            result.CodeInfo.Should().BeEquivalentTo(CoreErrorCodes.ValidationFailed);
            result.Details.Should().BeEquivalentTo <ExecutionError>(executionErrors);
        }
 /// <summary>
 /// Creates Validation Failed result with internal errors.
 /// </summary>
 /// <param name="internalErrors">Internal errors.</param>
 /// <returns>Execution result.</returns>
 protected static IExecutionResult ValidationFailed(IReadOnlyCollection <ExecutionError> internalErrors)
 {
     return(FailedResult.ValidationFailed(internalErrors));
 }