Exemplo n.º 1
0
        public void ConstructionAllowsAnErrorByComponents()
        {
            var expectedError = new Error("Code", "Path", "Description");
            var set           = new ErrorSet(expectedError.Code, expectedError.MemberPath, expectedError.Description);

            set.Should().NotBeNull("because the construction should have been successful");

            set.Errors.Should().HaveCount(1, "because the provided error should be the only one present.")
            .And.Equal(new[] { expectedError }, (left, right) => ((left.Code == right.Code) && (left.Description == right.Description)), "because the provided error should have been used for the final error set");
        }