Ejemplo n.º 1
0
        public void TestDestinyExceptionMessage()
        {
            var destinyException = new RouteException("ORI", "DES");

            Assert.AreEqual("Route cannot be found between ORI and DES!", destinyException.Message);
            Assert.IsTrue(destinyException is BusinessException);
        }
        /// <summary>
        /// Method returns routing exception message string
        /// </summary>
        /// <param name="e"></param>
        /// <returns></returns>
        public static string FormatRoutingExceptionMsg(RouteException e)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append((string)App.Current.FindResource("ErrorExecutingRouteCommandString"));
            sb.Append(e.Message);

            if (e.Details != null)
            {
                foreach (string msg in e.Details)
                {
                    sb.Append(LINE_TRANSFER);
                    sb.Append(msg);
                }
            }

            return(sb.ToString());
        }