Exemplo n.º 1
0
        public void Constructor_WithInnerException()
        {
            // Arrange

            var issue          = ValidationIssue.Error("Foo");
            var innerException = new InvalidOperationException();

            // Act

            var exception = new ValidationIssueException(issue, innerException);

            // Assert

            Assert.NotNull(exception.InnerException);
            Assert.Equal(innerException, exception.InnerException);
        }
Exemplo n.º 2
0
        public void Constructor_Valid()
        {
            // Arrange

            var issue = ValidationIssue.Error("Foo");

            // Act

            var exception = new ValidationIssueException(issue);

            // Assert

            Assert.Null(exception.InnerException);
            Assert.NotNull(exception.OperationResult);
            Assert.NotNull(exception.OperationResult.ValidationIssues);
            var actualIssue = Assert.Single(exception.OperationResult.ValidationIssues);

            Assert.Equal(issue, actualIssue);
        }