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 }; }
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 }); }
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); }
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); }
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 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); }
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); }