Exemplo n.º 1
0
            public void ReturnsSqlException()
            {
                // Arrange -> Act
                var sqlException = SqlClientUtil.CreateSqlException(message, errorCollection, innerException, conId);

                // Assert
                Assert.IsAssignableFrom <SqlException>(sqlException);
            }
Exemplo n.º 2
0
            public void HasNoParams_ReturnsSqlException()
            {
                // Arrange -> Act
                var ex = SqlClientUtil.CreateSqlException(message, innerException, conId);

                // Assert
                Assert.IsAssignableFrom <SqlException>(ex);
            }
Exemplo n.º 3
0
            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 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 ReturnsSqlException()
            {
                // Arrange
                var message        = "myMessage";
                var innerException = SqlClientUtil.CreateSqlException();
                var commandText    = "myCommandText";
                var ex             = new SqlCommandException(message, innerException, commandText);

                // Act
                var innerException2 = ex.InnerException;

                // Assert
                Assert.IsAssignableFrom <SqlException>(innerException2);
            }