public static void Constructor_With_Message(string message) { // Arrange // Act var ex = new RepositoryGuardException(message); // Assert Assert.NotNull(ex); }
public static void Constructor_With_No_Parameters() { // Arrange // Act var ex = new RepositoryGuardException(); // Assert Assert.NotNull(ex); }
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); }
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); }
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); }