Exemple #1
0
        public static void Constructor_With_Message(string message)
        {
            // Arrange

            // Act
            var ex = new RepositoryGuardException(message);

            // Assert
            Assert.NotNull(ex);
        }
Exemple #2
0
        public static void Constructor_With_No_Parameters()
        {
            // Arrange

            // Act
            var ex = new RepositoryGuardException();

            // Assert
            Assert.NotNull(ex);
        }
Exemple #3
0
        public static void Constructor_With_ErrorNumber(int number)
        {
            // Arrange

            // Act
            var ex = new RepositoryGuardException(number);

            // Assert
            Assert.NotNull(ex.Message);
            Assert.Equal(number, ex.Number);
        }
Exemple #4
0
        public static void Constructor_With_Message_And_InnerException(string message, Type type)
        {
            // Arrange
            Exception inner = type != null ? (Exception)Activator.CreateInstance(type) : null;

            // Act
            var ex = new RepositoryGuardException(message, inner);

            // Assert
            Assert.NotNull(ex);
            Assert.Equal(inner, ex.InnerException);
        }
Exemple #5
0
        public static void Constructor_With_FailureArea_And_InnerException(int number, Type type)
        {
            // Arrange
            Exception inner = type != null ? (Exception)Activator.CreateInstance(type) : null;

            // Act
            var ex = new RepositoryGuardException(number, inner);

            // Assert
            Assert.NotNull(ex.Message);
            Assert.Equal(number, ex.Number);
            Assert.Equal(inner, ex.InnerException);
        }