コード例 #1
0
        public void Constructor_Should_Set_Property()
        {
            var errorInfo = new[] { new ErrorInfo("Dummy", "Error!") };
            var exception = new RulesException(errorInfo);

            Assert.Equal(exception.Errors, errorInfo);
        }
コード例 #2
0
        public void Constructor_Should_Create_ErrorInfo_List_Without_Object()
        {
            var exception = new RulesException("Dummy", "Error!");

            Assert.Equal(1, exception.Errors.Count());
            Assert.Equal("Dummy", exception.Errors.First().PropertyName);
            Assert.Equal("Error!", exception.Errors.First().ErrorMessage);
            Assert.Equal(null, exception.Errors.First().Object);
        }