Exemplo n.º 1
0
        public static cmisFaultType CreateFault(enumServiceException type, string message = null)
        {
            var code = 500;
            switch (type)
            {
                case enumServiceException.constraint:
                case enumServiceException.nameConstraintViolation:
                case enumServiceException.contentAlreadyExists:
                case enumServiceException.updateConflict:
                case enumServiceException.versioning:
                    code = 409;
                    break;
                case enumServiceException.filterNotValid:
                case enumServiceException.invalidArgument:
                    code = 400;
                    break;
                case enumServiceException.notSupported:
                    code = 405;
                    break;
                case enumServiceException.objectNotFound:
                    code = 404;
                    break;
                case enumServiceException.permissionDenied:
                case enumServiceException.streamNotSupported:
                    code = 403;
                    break;
                case enumServiceException.runtime:
                case enumServiceException.storage:
                default:
                    code = 500;
                    break;
            }

            return new cmisFaultType() { type = type, code = code.ToString(), message = message };
        }
Exemplo n.º 2
0
        public static cmisFaultType CreateFault(enumServiceException type, string message = null)
        {
            var code = 500;

            switch (type)
            {
            case enumServiceException.constraint:
            case enumServiceException.nameConstraintViolation:
            case enumServiceException.contentAlreadyExists:
            case enumServiceException.updateConflict:
            case enumServiceException.versioning:
                code = 409;
                break;

            case enumServiceException.filterNotValid:
            case enumServiceException.invalidArgument:
                code = 400;
                break;

            case enumServiceException.notSupported:
                code = 405;
                break;

            case enumServiceException.objectNotFound:
                code = 404;
                break;

            case enumServiceException.permissionDenied:
            case enumServiceException.streamNotSupported:
                code = 403;
                break;

            case enumServiceException.runtime:
            case enumServiceException.storage:
            default:
                code = 500;
                break;
            }

            return(new cmisFaultType()
            {
                type = type, code = code.ToString(), message = message
            });
        }
Exemplo n.º 3
0
        private void assertAllVersionsReceivingWithExpectedException(string repositoryId, string versionSeriesId, string filter, bool allowableActions, enumServiceException expectedException, string caseMessage)
        {
            HashSet <enumServiceException> expectedExceptions = new HashSet <enumServiceException>();

            expectedExceptions.Add(expectedException);
            assertAllVersionsReceivingWithExpectedException(repositoryId, versionSeriesId, filter, allowableActions, expectedExceptions, caseMessage);
        }
Exemplo n.º 4
0
        private void cancelCheckoutAndAssertWithExpectedException(string repositoryId, string documentId, enumServiceException expectedException, string caseMessage)
        {
            HashSet <enumServiceException> expectedExceptions = new HashSet <enumServiceException>();

            expectedExceptions.Add(expectedException);
            cancelCheckoutAndAssertWithExpectedException(repositoryId, documentId, expectedExceptions, caseMessage);
        }
Exemplo n.º 5
0
        private void assertLatestVersionPropertiesReceivingWithExcpectedException(string repositoryId, string versionSeriesId, string filter, bool major, enumServiceException expectedException, string caseMessage)
        {
            HashSet <enumServiceException> expectedExceptions = new HashSet <enumServiceException>();

            expectedExceptions.Add(expectedException);
            assertLatestVersionPropertiesReceivingWithExcpectedException(repositoryId, versionSeriesId, filter, major, expectedExceptions, caseMessage);
        }
Exemplo n.º 6
0
        private void checkInAndAssertWithExpectedException(string repositoryId, string checkedoutDocumentId, Nullable <bool> major, cmisPropertiesType properties, cmisContentStreamType content, string checkInComment, enumServiceException expectedException, string caseMessage)
        {
            HashSet <enumServiceException> expectedExceptions = new HashSet <enumServiceException>();

            expectedExceptions.Add(expectedException);
            checkInAndAssertWithExpectedException(repositoryId, checkedoutDocumentId, major, properties, content, checkInComment, expectedExceptions, caseMessage);
        }
Exemplo n.º 7
0
 public void assertException(FaultException<cmisFaultType> actualException, enumServiceException expectedException)
 {
     HashSet<enumServiceException> exceptionsSet = new HashSet<enumServiceException>();
     exceptionsSet.Add(expectedException);
     assertException(actualException, exceptionsSet);
 }
 private void checkoutAndAssertWithExpectedException(string repositoryId, string documentId, bool forceCanceling, enumServiceException expectedException, string caseMessage)
 {
     HashSet<enumServiceException> expectedExceptions = new HashSet<enumServiceException>();
     expectedExceptions.Add(expectedException);
     checkoutAndAssertWithExpectedException(repositoryId, documentId, forceCanceling, expectedExceptions, caseMessage);
 }
 private void checkInAndAssertWithExpectedException(string repositoryId, string checkedoutDocumentId, Nullable<bool> major, cmisPropertiesType properties, cmisContentStreamType content, string checkInComment, enumServiceException expectedException, string caseMessage)
 {
     HashSet<enumServiceException> expectedExceptions = new HashSet<enumServiceException>();
     expectedExceptions.Add(expectedException);
     checkInAndAssertWithExpectedException(repositoryId, checkedoutDocumentId, major, properties, content, checkInComment, expectedExceptions, caseMessage);
 }
 private void assertLatestVersionPropertiesReceivingWithExcpectedException(string repositoryId, string versionSeriesId, string filter, bool major, enumServiceException expectedException, string caseMessage)
 {
     HashSet<enumServiceException> expectedExceptions = new HashSet<enumServiceException>();
     expectedExceptions.Add(expectedException);
     assertLatestVersionPropertiesReceivingWithExcpectedException(repositoryId, versionSeriesId, filter, major, expectedExceptions, caseMessage);
 }
 private void assertAllVersionsReceivingWithExpectedException(string repositoryId, string versionSeriesId, string filter, bool allowableActions, enumServiceException expectedException, string caseMessage)
 {
     HashSet<enumServiceException> expectedExceptions = new HashSet<enumServiceException>();
     expectedExceptions.Add(expectedException);
     assertAllVersionsReceivingWithExpectedException(repositoryId, versionSeriesId, filter, allowableActions, expectedExceptions, caseMessage);
 }