示例#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);
        }