Example #1
0
        public void GivenSingleException_WhenCtor_ThenMessageSet_Test()
        {
            var ex    = new Exception("message");
            var ndmex = new NormalizationDataMappingException(ex);

            Assert.Equal(ex.Message, ndmex.Message);
        }
Example #2
0
        public void GivenMultipleExceptions_WhenCtor_ThenEachMessageSet_Test()
        {
            var ex2 = new Exception("nested b");
            var ex1 = new Exception("nested a", ex2);
            var ex  = new Exception("message", ex1);

            var ndmex = new NormalizationDataMappingException(ex);

            var messages = ndmex.Message.Split('\n');

            Assert.Equal(3, messages.Length);
            Assert.Equal(ex.Message, messages[0]);
            Assert.Equal($"1:{ex1.Message}", messages[1]);
            Assert.Equal($"2:{ex2.Message}", messages[2]);
        }