public void HasParams_ReturnsSqlErrorCollectionWithErrors() { // Arrange var sqlError = SqlClientUtil.CreateSqlError(0); // Act var errorCollection = SqlClientUtil.CreateSqlErrorCollection(sqlError); // Assert Assert.Contains(sqlError, errorCollection.OfType <SqlError>()); }
public void HasParams_ReturnsSqlExceptionWithErrors() { // Arrange var sqlError = SqlClientUtil.CreateSqlError(0); // Act var ex = SqlClientUtil.CreateSqlException(message, innerException, conId, sqlError); // Assert Assert.Contains(sqlError, ex.Errors.OfType <SqlError>()); }
public void ReturnsSqlError() { // Arrange int infoNumber = 0; // Act var error = SqlClientUtil.CreateSqlError(infoNumber); // Assert Assert.IsAssignableFrom <SqlError>(error); }
public void ExIsSqlCommandExceptionAndDoesNotContainSqlErrorWithNumberIs2_ReturnsFalse() { // Arrange var sqlError = SqlClientUtil.CreateSqlError(0); var sqlException = SqlClientUtil.CreateSqlException(sqlError); var ex = new SqlCommandException(null, sqlException, null); // Act var isTransient = LeaderboardsStoreClient.IsTransient(ex); // Assert Assert.False(isTransient); }
public void ReturnsSqlError() { // Arrange int infoNumber = 0; byte errorState = 0; byte errorClass = 0; string server = "server"; string errorMessage = "errorMessage"; string procedure = "procedure"; int lineNumber = 0; uint win32ErrorCode = 0; // Act var error = SqlClientUtil.CreateSqlError(infoNumber, errorState, errorClass, server, errorMessage, procedure, lineNumber, win32ErrorCode); // Assert Assert.IsAssignableFrom <SqlError>(error); }
public void AddsError() { // Arrange var errorCollection = SqlClientUtil.CreateSqlErrorCollection(); int infoNumber = 0; byte errorState = 0; byte errorClass = 0; string server = "server"; string errorMessage = "errorMessage"; string procedure = "procedure"; int lineNumber = 0; uint win32ErrorCode = 0; var error = SqlClientUtil.CreateSqlError(infoNumber, errorState, errorClass, server, errorMessage, procedure, lineNumber, win32ErrorCode); // Act errorCollection.Add(error); // Assert Assert.Same(error, errorCollection[0]); }